简介
useHooks
A collection of modern, server-safe React hooks – from the ui.dev team.
Compatible with React v18.0.0+.
Standard
Install
npm i @uidotdev/usehooks
Hooks
- useBattery
- useClickAway
- useCopyToClipboard
- useCounter
- useDebounce
- useDefault
- useDocumentTitle
- useFavicon
- useGeolocation
- useHistoryState
- useHover
- useIdle
- useIntersectionObserver
- useIsClient
- useIsFirstRender
- useList
- useLocalStorage
- useLockBodyScroll
- useLongPress
- useMap
- useMeasure
- useMediaQuery
- useMouse
- useNetworkState
- useObjectState
- useOrientation
- usePreferredLanguage
- usePrevious
- useQueue
- useRenderCount
- useRenderInfo
- useScript
- useSessionStorage
- useSet
- useThrottle
- useToggle
- useVisibilityChange
- useWindowScroll
- useWindowSize
Experimental
Install
npm i @uidotdev/usehooks@experimental react@experimental react-dom@experimental