diff --git a/examples/forwarding-refs/log-props-after.js b/examples/forwarding-refs/log-props-after.js index bab64385..e864c1fd 100644 --- a/examples/forwarding-refs/log-props-after.js +++ b/examples/forwarding-refs/log-props-after.js @@ -1,8 +1,8 @@ function logProps(WrappedComponent) { class LogProps extends React.Component { - componentWillReceiveProps(nextProps) { - console.log('old props:', this.props); - console.log('new props:', nextProps); + componentDidUpdate(prevProps) { + console.log('old props:', prevProps); + console.log('new props:', this.props); } render() { diff --git a/examples/forwarding-refs/log-props-before.js b/examples/forwarding-refs/log-props-before.js index 13659449..a507e818 100644 --- a/examples/forwarding-refs/log-props-before.js +++ b/examples/forwarding-refs/log-props-before.js @@ -1,9 +1,9 @@ // highlight-next-line function logProps(WrappedComponent) { class LogProps extends React.Component { - componentWillReceiveProps(nextProps) { - console.log('old props:', this.props); - console.log('new props:', nextProps); + componentDidUpdate(prevProps) { + console.log('old props:', prevProps); + console.log('new props:', this.props); } render() {