Skip to content

Instantly share code, notes, and snippets.

@janpaepke
Created July 4, 2022 09:47
Show Gist options
  • Select an option

  • Save janpaepke/3985a5474bdd4e4cda9a428661c3c627 to your computer and use it in GitHub Desktop.

Select an option

Save janpaepke/3985a5474bdd4e4cda9a428661c3c627 to your computer and use it in GitHub Desktop.
useEffect(() => {
const timeoutId = setTimeout(() => alert('one second has passed!'), 1000);
return () => {
clearTimeout(timeoutId);
};
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment