Skip to content

Commit

Permalink
fix(transformer): 第三方组件不处理 key 和事件,close #521
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Aug 26, 2018
1 parent 0b4d7ce commit 4b72496
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/taro-transformer-wx/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ export class RenderParser {
let eventShouldBeCatched = false
const jsxElementPath = path.parentPath.parentPath
if (t.isJSXIdentifier(name) && jsxElementPath.isJSXElement()) {
const componentName = (jsxElementPath.node.openingElement as any).name.name
if (THIRD_PARTY_COMPONENTS.has(componentName as string)) {
return
}
if (name.name === 'key') {
const jsx = path.findParent(p => p.isJSXElement())
const loopBlock = jsx.findParent(p => {
Expand Down

0 comments on commit 4b72496

Please sign in to comment.