👍
react-use






Collection of essential React Hooks.
This is mostly port of libreact to React Hooks.




npm i react-use


## Reference - [__Sensors__](./docs/Sensors.md) - [`useBattery`](./docs/useBattery.md) — tracks device batter state. - [`useGeolocation`](./docs/useGeolocation.md) — tracks geo location state of user's device. - [`useHover`](./docs/useHover.md) — tracks mouse hover state of some element. - [`useIdle`](./docs/useIdle.md) — tracks whether user is being inactive. - [`useLocation`](./docs/useLocation.md) — tracks page navigation bar location state. - [`useMedia`](./docs/useMedia.md) — tracks state of a CSS media query. - [`useMediaDevices`](./docs/useMediaDevices.md) — tracks state of connected hardware devices. - [`useMotion`](./docs/useMotion.md) — tracks state of device's motion sensor. - [`useNetwork`](./docs/useNetwork.md) — tracks state of user's internet connection. - [`useOrientation`](./docs/useOrientation.md) — tracks state of device's screen orientation. - [`useSize`](./docs/useSize.md) — tracks some HTML element's dimensions. - [`useWindowSize`](./docs/useWindowSize.md) — tracks `Window` dimensions.

- [__Animations__](./docs/Animations.md) - [`useSpring`](./docs/useSpring.md) — interpolates number over time according to spring dynamics. - [`useTimeout`](./docs/useTimeout.md) — returns true after a timeout.

- [__Side-effects__](./docs/Side-effects.md) - [`useCss`](./docs/useCss.md) — dynamically adjusts CSS. - [`useFavicon`](./docs/useFavicon.md) — sets favicon of the page. - [`useTitle`](./docs/useTitle.md) — sets title of the page.

- [__State__](./docs/State.md) - [`useToggle`](./docs/useToggle.md) — tracks state of a boolean. - [`useCounter`](./docs/useCounter.md) — tracks state of a number. - [`useList`](./docs/useList.md) — tracks state of an array. - [`useMap`](./docs/useMap.md) — tracks state of an object.

## Usage - You need to have React `16.7.0-alpha.0` or later installed to use Hooks API. - You can import each hook individually `import useToggle from 'react-use/lib/useToggle'`. ## License [Unlicense](./LICENSE) — public domain.