@pastable/react

  • atomWithToggle: Jotai specific. Like if useToggle & useAtom & useLocalStorage had a child.
  • useClickAway: Detect and invoke a callback when clicking away of target element.
  • useEvent: Define an event listener on window or a given element declaratively
  • useForceUpdate: One liner to force a re-render when needed
  • useIsMounted: Keep track of a component mounted using ref/state.
  • useQueryParams: Allows you to get/set page history with query params, usable like a useState.
  • useSelection: Like if useState had a child with Array. Makes it easy to work with an array of objects with all the actions available.
  • useUpdateEffect: React effect hook that invokes only on update. (taken from chakra-ui)
  • usePreloadImages: Preload images urls so they can appear instantly when needed