title: react hooks props in useEffect
body: <p>I have started using <code>react-hooks</code> and there is something I am trying to understand.
  I have this <code>useEffect</code> hook, I'm separating my <code>useEffect</code> hooks, I want to know when each hook runs. </p>
  
  <pre><code>function MyComp(props) {
      useEffect(
         () =&gt; {
           fetchSomeData(props.filters)
         },[props.filters]
       )
      return (
          &lt;div&gt;will show my data here&lt;/div&gt;
       )
  }
  </code></pre>
  
  <p>Will this hook only run when <code>props.filters</code> has changed?</p>
  
  <p>Or do I have to use the <code>prevProps</code> to check if it has changed?</p>
  
  <p>Like this:</p>
  
  <pre><code>function MyComp(props) {
     const prevProps = useRef(props);
     useEffect(
         () =&gt; {
             if (prevProps.filters !== props.filters) {            
                fetchSomeData(props.filters)
             }
         },[props.filters]
     )
     return (
       &lt;div&gt;will show my data here&lt;/div&gt;
     )
  }
  </code></pre>