title: How to fix React WArning : Can't perform a React state update on an unmounted component
body: <p>Whenever if there is any asynchronous task performing related to component and that component unmounts then React generally gives this warning -</p>
  <p><code>Can't perform a React state update on an unmounted component This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.</code></p>
  <p>I found some solutions over internet to use isMount flag (either by using it with useRef or useState) as true and then updating it to false on component unmount. But is that a proper solution as per React site using isMount is a antipattern.</p>
  <p><a href="https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html" rel="nofollow noreferrer">https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html</a></p>