react-ui-hooks
react-ui-hooks copied to clipboard
Add two window hooks
Create two hooks:
useWindowEvent- React hook that will subscribe to an event in thewindowwhen the component is mounted and will unsubscribe the event when the component unmount.useWindowSize- React hook to get the current window size (width,height). This hook will listen to the resize window event to always keep the size up to date.