@@ -11,12 +11,12 @@ React Native APIs turned into React Hooks allowing you to access asynchronous AP
11
11
### Installation with npm
12
12
13
13
``` sh
14
- npm install react-native-hooks
14
+ npm install @ react-native-community/ hooks
15
15
```
16
16
17
17
Installation with yarn
18
18
``` sh
19
- yarn add react-native-hooks
19
+ yarn add @ react-native-community/ hooks
20
20
```
21
21
22
22
## API
@@ -34,7 +34,7 @@ yarn add react-native-hooks
34
34
### ` useAccessibilityInfo `
35
35
36
36
``` js
37
- import { useAccessibilityInfo } from ' react-native-hooks'
37
+ import { useAccessibilityInfo } from ' @ react-native-community/ hooks'
38
38
39
39
const isScreenReaderEnabled = useAccessibilityInfo ()
40
40
```
@@ -44,15 +44,15 @@ const isScreenReaderEnabled = useAccessibilityInfo()
44
44
AppState will change between one of 'active', 'background', or (iOS) 'inactive' when the app is closed or put into the background.
45
45
46
46
``` js
47
- import { useAppState } from ' react-native-hooks'
47
+ import { useAppState } from ' @ react-native-community/ hooks'
48
48
49
49
const currentAppState = useAppState ()
50
50
```
51
51
52
52
### ` useBackHandler `
53
53
54
54
``` js
55
- import { useBackHandler } from ' react-native-hooks'
55
+ import { useBackHandler } from ' @ react-native-community/ hooks'
56
56
57
57
useBackHandler (() => {
58
58
if (shouldBeHandledHere) {
@@ -67,7 +67,7 @@ useBackHandler(() => {
67
67
### ` useCameraRoll `
68
68
69
69
``` js
70
- import { useCameraRoll } from ' react-native-hooks'
70
+ import { useCameraRoll } from ' @ react-native-community/ hooks'
71
71
72
72
const [photos , getPhotos , saveToCameraRoll ] = useCameraRoll ()
73
73
@@ -81,7 +81,7 @@ const [photos, getPhotos, saveToCameraRoll] = useCameraRoll()
81
81
### ` useClipboard `
82
82
83
83
``` js
84
- import { useClipboard } from ' react-native-hooks'
84
+ import { useClipboard } from ' @ react-native-community/ hooks'
85
85
86
86
const [data , setString ] = useClipboard ()
87
87
@@ -95,7 +95,7 @@ const [data, setString] = useClipboard()
95
95
Gets dimensions and sets up a listener that will change the dimensions if the user changes device orientation.
96
96
97
97
``` js
98
- import { useDimensions } from ' react-native-hooks'
98
+ import { useDimensions } from ' @ react-native-community/ hooks'
99
99
100
100
const dimensions = useDimensions ()
101
101
// or
@@ -107,7 +107,7 @@ const screen = useDimensions().screen
107
107
### ` useKeyboard `
108
108
109
109
``` js
110
- import { useKeyboard } from ' react-native-hooks'
110
+ import { useKeyboard } from ' @ react-native-community/ hooks'
111
111
112
112
const keyboard = useKeyboard ()
113
113
@@ -118,7 +118,7 @@ console.log('keyboard keyboardHeight: ', keyboard.keyboardHeight)
118
118
### ` useInteractionManager `
119
119
120
120
``` js
121
- import { useInteractionManager } from ' react-native-hooks'
121
+ import { useInteractionManager } from ' @ react-native-community/ hooks'
122
122
123
123
const interactionReady = useInteractionManager ()
124
124
@@ -128,7 +128,7 @@ console.log('interaction ready: ', interactionReady)
128
128
### ` useDeviceOrientation `
129
129
130
130
``` js
131
- import { useDeviceOrientation } from ' react-native-hooks'
131
+ import { useDeviceOrientation } from ' @ react-native-community/ hooks'
132
132
133
133
const orientation = useDeviceOrientation ()
134
134
@@ -139,7 +139,7 @@ console.log('is orientation landscape: ', orientation.landscape)
139
139
### ` useLayout `
140
140
141
141
``` js
142
- import { useLayout } from ' react-native-hooks'
142
+ import { useLayout } from ' @ react-native-community/ hooks'
143
143
144
144
const { onLayout , ... layout } = useLayout ()
145
145
@@ -148,5 +148,5 @@ console.log('layout: ', layout)
148
148
< View onLayout= {onLayout} style= {{width: 200 , height: 200 , marginTop: 30 }} / >
149
149
```
150
150
151
- [ version-badge ] : https://img.shields.io/npm/v/react-native-hooks.svg?style=flat-square
152
- [ package ] : https://www.npmjs.com/package/react-native-hooks
151
+ [ version-badge ] : https://img.shields.io/npm/v/@ react-native-community/ hooks.svg?style=flat-square
152
+ [ package ] : https://www.npmjs.com/package/@ react-native-community/ hooks
0 commit comments