Skip to content

Commit 14a78be

Browse files
committed
Replace deprecated componentWillReceiveProps with componentDid(Mount|Update).
1 parent 7a0fbe6 commit 14a78be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ActionSheetCustom.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ class ActionSheet extends Component {
3636
}
3737
}
3838

39-
componentWillReceiveProps(nextProps) {
40-
this.translateY = this.calculateHeight(nextProps)
39+
componentDidMount() {
40+
this.translateY = this.calculateHeight(this.props)
41+
}
42+
43+
componentDidUpdate(prevProps, prevState) {
44+
this.translateY = this.calculateHeight(prevProps)
4145
}
4246

4347
show() {

0 commit comments

Comments
 (0)