mirror of
https://github.com/streamich/react-use.git
synced 2026-01-25 14:17:16 +00:00
Added named import example to readme
This commit is contained in:
parent
418438ec22
commit
1a63a0dc0d
@ -136,7 +136,11 @@ You can import each hook individually <code>import useToggle from 'react-use/lib
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Depending on your bundler you might run into a missing dependency error. 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 <a href="https://github.com/ant-design/babel-plugin-import">babel-plugin-import</a> by adding the following config to your `.babelrc` file:
|
||||
or use ES6 named imports <code>import {useToggle} from 'react-use'</code>.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
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 <a href="https://github.com/ant-design/babel-plugin-import">babel-plugin-import</a> by adding the following config to your `.babelrc` file:
|
||||
</p>
|
||||
|
||||
```json
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user