@pastable/react
TypeScript icon, indicating that this package has built-in type declarations

0.1.15 • Public • Published

@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

Package Sidebar

Install

npm i @pastable/react

Weekly Downloads

3

Version

0.1.15

License

none

Unpacked Size

158 kB

Total Files

31

Last publish

Collaborators

  • astahmer