Skip to content

Commit 981f444

Browse files
committed
fix(react): Upgrade componentWillReceiveProps #201
1 parent 7cfbad9 commit 981f444

File tree

1 file changed

+5
-5
lines changed
  • templates/react/components/foo

1 file changed

+5
-5
lines changed

templates/react/components/foo/List.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class List extends Component {
2222
);
2323
}
2424

25-
componentWillReceiveProps(nextProps) {
26-
if (this.props.match.params.page !== nextProps.match.params.page)
27-
nextProps.list(
28-
nextProps.match.params.page &&
29-
decodeURIComponent(nextProps.match.params.page)
25+
componentDidUpdate(prevProps) {
26+
if (this.props.match.params.page !== prevProps.match.params.page)
27+
this.props.list(
28+
this.props.match.params.page &&
29+
decodeURIComponent(this.props.match.params.page)
3030
);
3131
}
3232

0 commit comments

Comments
 (0)