Skip to content

Commit

Permalink
fix(Transition): 修复 state.display 的赋值逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Mar 19, 2019
1 parent f1ec98d commit 82b458b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Transition/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export default class MTransition extends component({
}

componentWillReceiveProps(nextProps: MTransition['props']) {
this.setState({
display: true,
this.setState(prevState => ({
display: prevState.display || nextProps.visible,
type: nextProps.visible ? TransitionType.Enter : TransitionType.Leave,
})
}))
}

handleAnimationEnd = () => {
Expand Down

0 comments on commit 82b458b

Please sign in to comment.