Skip to content

Commit

Permalink
fix(transformer): 第三方组件绑定事件可以用 bind,close #3859
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jul 17, 2019
1 parent ef65a09 commit 896832d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/render-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Cat extends Taro.Component {
render() {
const { mouse } = this.props;
return (
<img src={catImage} style={{ position: 'absolute', left: mouse.x, top: mouse.y }} />
<Image src={catImage} style={{ position: 'absolute', left: mouse.x, top: mouse.y }} />
);
}
}
Expand Down
9 changes: 6 additions & 3 deletions packages/taro-transformer-wx/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,13 @@ export class RenderParser {
const componentName = JSXElement.openingElement.name
if (
isNewPropsSystem() &&
t.isJSXIdentifier(componentName) &&
!DEFAULT_Component_SET.has(componentName.name)
t.isJSXIdentifier(componentName)
) {
return
if (THIRD_PARTY_COMPONENTS.has(componentName.name)) {
//
} else if (!DEFAULT_Component_SET.has(componentName.name)) {
return
}
}

// const JSXAttribute = path.findParent(p => p.isJSXAttribute())
Expand Down

0 comments on commit 896832d

Please sign in to comment.