Skip to content

Instantly share code, notes, and snippets.

@chrisryana
Last active December 2, 2020 07:16
Show Gist options
  • Save chrisryana/c83ca33f74867ba5d5da05fac6ffd201 to your computer and use it in GitHub Desktop.
Save chrisryana/c83ca33f74867ba5d5da05fac6ffd201 to your computer and use it in GitHub Desktop.
Шаблон навешивания событий с помощью useEffect
useEffect(() => {
window.addEventListener('resize', getBlur);
return () => {
window.removeEventListener('resize', getBlur);
};
// запустится один раз
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment