"# useOnGlobalEvent-react-hook" Use the useRef() hook to create a variable, listener, which will hold the listener reference. Use the useRef() hook to create a variable that will hold the previous values of the type and options arguments. Use the useEffect() hook and EventTarget.addEventListener() to listen to the given event type on the Window global object. Use EventTarget.removeEventListener() to remove any existing listeners and clean up when the component unmounts.
-
Notifications
You must be signed in to change notification settings - Fork 0
aozoragh/useOnGlobalEvent-react-hook
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
About
Executes a callback whenever an event occurs on the global object.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published