Skip to content

Commit 17dd1f1

Browse files
committed
Remove peer deps
1 parent 0f137d8 commit 17dd1f1

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

docs/Usage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You need to have React [`16.8.0`](https://reactjs.org/blog/2019/02/06/react-v16.
66
import useToggle from 'react-use/lib/useToggle'
77
```
88

9-
or use ES6 named imports
9+
or use ES6 named imports (tree shaking recommended)
1010

1111
```js
1212
import {useToggle} from 'react-use'

docs/useKeyboardJs.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const Demo = () => {
2222
};
2323
```
2424

25+
Note: Because of dependency on `keyboardjs` you have to import this hook directly like shown above.
26+
2527
## Requirements
2628

2729
Install [`keyboardjs`](https://github.com/RobertWHurst/KeyboardJS) peer dependency:

docs/useSpring.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ to spring dynamics.
66
## Usage
77

88
```jsx
9-
import {useSpring} from 'react-use';
9+
import useSpring from 'react-use/lib/useSprint';
1010

1111
const Demo = () => {
1212
const [target, setTarget] = useState(50);
@@ -23,6 +23,8 @@ const Demo = () => {
2323
};
2424
```
2525

26+
Note: Because of dependency on `rebound` you have to import this hook directly like shown above.
27+
2628
## Requirements
2729

2830
Install [`rebound`](https://github.com/facebook/rebound-js) peer dependency:

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@
5555
"ts-easing": "^0.2.0"
5656
},
5757
"peerDependencies": {
58-
"keyboardjs": "*",
5958
"react": "^16.8.0",
60-
"react-dom": "^16.8.0",
61-
"rebound": "*"
59+
"react-dom": "^16.8.0"
6260
},
6361
"devDependencies": {
6462
"@babel/core": "7.5.4",

src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import useIdle from './useIdle';
2828
import useInterval from './useInterval';
2929
import useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';
3030
import useKey from './useKey';
31-
import useKeyboardJs from './useKeyboardJs';
31+
// not exported because of peer dependency
32+
// import useKeyboardJs from './useKeyboardJs';
3233
import useKeyPress from './useKeyPress';
3334
import useKeyPressEvent from './useKeyPressEvent';
3435
import useLifecycles from './useLifecycles';
@@ -60,7 +61,8 @@ import useSessionStorage from './useSessionStorage';
6061
import useSetState from './useSetState';
6162
import useSize from './useSize';
6263
import useSpeech from './useSpeech';
63-
import useSpring from './useSpring';
64+
// not exported because of peer dependency
65+
// import useSpring from './useSpring';
6466
import useStartTyping from './useStartTyping';
6567
import useThrottle from './useThrottle';
6668
import useThrottleFn from './useThrottleFn';
@@ -107,7 +109,6 @@ export {
107109
useInterval,
108110
useIsomorphicLayoutEffect,
109111
useKey,
110-
useKeyboardJs,
111112
useKeyPress,
112113
useKeyPressEvent,
113114
useLifecycles,
@@ -139,7 +140,6 @@ export {
139140
useSetState,
140141
useSize,
141142
useSpeech,
142-
useSpring,
143143
useStartTyping,
144144
useThrottle,
145145
useThrottleFn,

0 commit comments

Comments
 (0)