title: Hooks equivalent for componentWilLReceiveProps to update state
body: <p>So I have a component where I conditionally update state on props change. If current state's CurrentPage is not equal to next props CurrentPage, I update state with next props' CurrentPage:</p>
  
  <pre><code>public componentWillReceiveProps(nextProps) {
      if (this.state.CurrentPage !== nextProps.CurrentPage) {
          this.setState({ CurrentPage: nextProps.CurrentPage });
      }
  }
  </code></pre>
  
  <p>I'm in the middle of refactoring the component do use hooks. I have a useState hook setup for CurrentPage when the component first loads:</p>
  
  <p><code>const [currentPage, setCurrentPage]</code> = useState(props.CurrentPage ? props.CurrentPage : 1);</p>
  
  <p>What would be the hook equivalent of the <code>componentWillReceiveProps</code> logic in this case? Thanks!</p>