Skip to content

Commit

Permalink
fix(taro): 组件更新时调用_createData
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Apr 20, 2018
1 parent 02e7ad8 commit b8508d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/taro/src/lifecycle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export function updateComponent (component, update) {
component._createData && component._createData()
const props = component.props
const state = component.getState()
let state = component.getState()
if (component._createData) {
state = component._createData(state)
}
const prevProps = component.prevProps || props
const prevState = component.prevState || state
component.props = prevProps
Expand Down

0 comments on commit b8508d5

Please sign in to comment.