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