title: UseEffect hook executes multiple times on updating state
body: <p>I am updating state of parent component from child component's useEffect hook. Follwing is the piece of code from child component. Here useEffect is getting called twice. Not sure how can I avoid it.</p>
  
  <pre class="lang-js prettyprint-override"><code>useEffect = () =&gt; { const flag = someApi; setStateOfParent(flag),[]}
  </code></pre>