Skip to content

Instantly share code, notes, and snippets.

@PhilipWee
Created October 28, 2022 03:45
Show Gist options
  • Save PhilipWee/ee7cd2ecf4acd7e585a023c15c70e560 to your computer and use it in GitHub Desktop.
Save PhilipWee/ee7cd2ecf4acd7e585a023c15c70e560 to your computer and use it in GitHub Desktop.
useEffect(() => {
return () => {
if (!timer.current) return;
clearTimeout(timer.current);
};
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment