when a react component unmounted it should not try to update state with useState hook that will cause memory leak.
when a react component unmounted it should not try to update state with useState hook that will cause memory leak.