A collection of hooks and utilities for React.
-
🔮 Typescript
Written in typescript so you get the advantage of strong type safety
-
🧠 Server Side Ready
All hooks handle SSR rendering and work well with frameworks like Next/Gatsby
npm i react-hooks-elib
# or
yarn add react-hooks-elib
Refer to this CodeSandbox for usage reference.
List of hooks included in the library so far.
-
useWindowSize
— Tracks browserWindow
dimensions -
useWindowScroll
— TracksWindow
scroll position. -
useToggle
anduseBoolean
— Tracks and manages state of a boolean -
useClipboard
— Hook to work with the clipboard -
useLocalStorage
— Hook to work with the local storage API. Supports syncing local storage values across tabs and rerender on change -
useWindowSize
— -
useWindowScroll
— -
useWindowEvent
— -
useTimeout
— -
useSafeLayoutEffect
— -
usePrevious
— -
useConst
— -
useMergeRefs
— -
useInterval
— -
useLatestRef
— -
useCallbackRef
—