talira

react-use

Large collection of ready-made React hooks for sensors, UI, side effects, lifecycles and state

open sourceUnlicensefree

react-use is a collection of React hooks grouped as sensors (geolocation, battery, media queries, mouse, scroll, keys, network state), UI, animations, side effects, lifecycles and state, such as useMedia, useIntersection, useLocalStorage, useDebounce and useAsync, so common browser and state logic doesn't have to be written by hand. It's released into the public domain.

Problems it solves

  • track window size or a media query in a React component without writing my own hook
  • debounce a value or call in React with a ready-made hook
  • find a library of common React hooks instead of copying them between projects

Features

  • sensor hooks: geolocation, battery, media queries, mouse, scroll, keyboard, network state
  • UI, animation and side-effect hooks
  • lifecycle and state hooks
  • interactive demos for many hooks