Skip to content

Commit

Permalink
fix(transformer): 修复 11964f8 对 JSX 属性判断错误,close #3697
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jul 8, 2019
1 parent b6c3be9 commit 24e717f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-transformer-wx/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export function setAncestorCondition (jsx: NodePath<t.Node>, expr: t.Expression)
Adapter.if,
Adapter.else
])
const logicalJSX = jsx.findParent(p => p.isJSXElement() && p.node.openingElement.attributes.some(a => t.isIdentifier(a.name) && ifAttrSet.has(a.name.name))) as NodePath<t.JSXElement>
const logicalJSX = jsx.findParent(p => p.isJSXElement() && p.node.openingElement.attributes.some(a => t.isJSXIdentifier(a.name) && ifAttrSet.has(a.name.name))) as NodePath<t.JSXElement>
if (logicalJSX) {
const attr = logicalJSX.node.openingElement.attributes.find(a => ifAttrSet.has(a.name.name as string))
if (attr) {
Expand Down

0 comments on commit 24e717f

Please sign in to comment.