title: getting error : Argument of type '() => () => boolean' is not assignable to parameter of type 'EffectCallback'
body: <p>i am new in typescript,i am getting error when i tried to use <code>useEffect</code> in typescript in react, <code>Argument of type '() =&gt; () =&gt; boolean' is not assignable to parameter of type 'EffectCallback'.</code>, can anyone please help me why i am getting this error ? here i have put my code, any help will be really appreciated,</p>
  <pre><code>const useIsMounted = () =&gt; {
          const isMounted = React.useRef(false);
          React.useEffect(() =&gt; {
            isMounted.current = true;
            return () =&gt; isMounted.current = false;
          }, []);
          return isMounted;
      };
  </code></pre>