Skip to content

Commit

Permalink
fix(transformer): 类函数式组件返回的 state 应该从 this.state取值
Browse files Browse the repository at this point in the history
close #3813
  • Loading branch information
yuche committed Jul 15, 2019
1 parent af2bf64 commit 5ec9679
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-transformer-wx/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,7 @@ export class RenderParser {
)
)
} else {
const usedState = Array.from(this.usedThisState).map(s => t.objectProperty(t.identifier(s), t.memberExpression(t.thisExpression(), t.identifier(s))))
const usedState = Array.from(this.usedThisState).map(s => t.objectProperty(t.identifier(s), t.memberExpression(t.memberExpression(t.thisExpression(), t.identifier('state')), t.identifier(s))))
this.renderPath.node.body.body.push(
// ...propsStatement,
t.returnStatement(t.objectExpression(pendingState.properties.concat(usedState)))
Expand Down

0 comments on commit 5ec9679

Please sign in to comment.