JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 70
  • Score
    100M100P100Q58289F
  • License MIT

Collection of useful React Hooks

Package Exports

  • @lyonph/react-hooks

Readme

Hooks

  • useCallbackCondition: Memoizes a callback function conditionally.
  • useConstant: Creates a component-level constant.
  • useConstantCallback: Creates a component-level constant callback.
  • useForceUpdate: Creates a callback that re-renders the component when called.
  • useFreshLazyRef:
  • useFreshState: useState but resets to initial state when dependency changes.
  • useFullscreenElement: Tracks document.fullscreenElement.
  • useIsomorphicEffect: SSR-friendly useLayoutEffect.
  • useLazyRef: useRef but with initializer callback.
  • useMediaQuery: Tracks media query match.
  • useMemoCondition: Memoizes conditionally.
  • useMountedState: Creates a callback that tracks the lifecycle state of the component.
  • useOnlineStatus: Tracks navigator.onLine.
  • usePageVisibility: Tracks document.visibilityState.
  • usePrefersDarkTheme
  • usePrefersLightTheme
  • usePrefersReducedMotion
  • useReadyState
  • useRenderCount
  • useSubscription
  • useWindowScroll
  • useWindowSize