/reusable-react-hooks

Reusable React Hooks

Primary LanguageJavaScript

Reusable React Hooks

This is just a list or react hooks that I've found, or developed that I added as an npm pacakge for easy re-use.

From wattenberger.com

  • useIsMounted For async code, check if the component is still mounted
  • useIsInView For triggering animations, for example
  • useHash For keeping the hash of the url in-sync with a local variable
  • usOnKeyPress For triggering code when a user presses a specific key
  • useChartDimensions Helps keeps charts / SVG responsive when the windo is resized

reactivestack

  • useCookie

overreacted.io

  • useInterval Useful for animations`

usehooks.com

  • useLocalStorage For keeping localStorage value in-sync with a local variable

From my projects:

  • useImageUpload - Dependent on how Image Upload is set up (coming soon)
  • useWindowSize - Helpful if calculating column sizes, for example