Skip to content

aizenka/react-use

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation



πŸ‘
react-use





npm package npm downloads demos
Collection of essential React Hooks. Port of libreact.
Translations: πŸ‡¨πŸ‡³ 汉语




npm i react-use








Usage


You need to have React 16.8.1 or later installed to use Hooks API.

You can import each hook individually import useToggle from 'react-use/lib/useToggle'.

or use ES6 named imports import {useToggle} from 'react-use'.

Depending on your bundler you might run into a missing dependency error with ES6 named import statements. Some hooks require you to install peer dependencies so we recommend using individual imports. If you want the best of both worlds you can transform the named import statements to individual import statements with babel-plugin-import by adding the following config to your `.babelrc` file:

[
  "import", {
    "libraryName": "react-use",
    "libraryDirectory": "lib",
    "camel2DashComponentName": false
  }
]

License

Unlicense β€” public domain.

Packages

No packages published

Languages

  • TypeScript 99.5%
  • JavaScript 0.5%