From 01c26919b439d6cb5faad706a73e3ac18f73c155 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Fri, 23 Mar 2018 07:48:28 -0700 Subject: [PATCH] Replaced cWRP in forwardRef example with cDU --- examples/forwarding-refs/log-props-after.js | 6 +++--- examples/forwarding-refs/log-props-before.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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() {