Render prop编译失败



  • 按照文档的写法:
    <View renderA={() => <View>text</View>} />

    编译时将报错:
    TypeError: Cannot read property 'isCallExpression' of null
    at handleJSXElement (/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/transformer-wx/lib/src/render.js:171:46)
    at RenderParser.handleJSXElement (/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/transformer-wx/lib/src/render.js:96:17)
    at exit (/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/transformer-wx/lib/src/render.js:164:26)
    at NodePath._call (/usr/local/lib/node_modules/@tarojs/cli/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/usr/local/lib/node_modules/@tarojs/cli/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/usr/local/lib/node_modules/@tarojs/cli/node_modules/babel-traverse/lib/path/context.js:117:8)
    at TraversalContext.visitQueue (/usr/local/lib/node_modules/@tarojs/cli/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitSingle (/usr/local/lib/node_modules/@tarojs/cli/node_modules/babel-traverse/lib/context.js:108:19)
    at TraversalContext.visit (/usr/local/lib/node_modules/@tarojs/cli/node_modules/babel-traverse/lib/context.js:192:19)
    at Function.traverse.node (/usr/local/lib/node_modules/@tarojs/cli/node_modules/babel-traverse/lib/index.js:114:17)

    版本1.3.20


登录后回复