Skip to content

Commit

Permalink
Merge pull request #56 from react-native-community/rename-for-rnc
Browse files Browse the repository at this point in the history
prepare for RNC
  • Loading branch information
pvinis committed Feb 15, 2020
2 parents 3d84abf + c9d40ef commit 15b0437
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions README.md
Expand Up @@ -11,12 +11,12 @@ React Native APIs turned into React Hooks allowing you to access asynchronous AP
### Installation with npm

```sh
npm install react-native-hooks
npm install @react-native-community/hooks
```

Installation with yarn
```sh
yarn add react-native-hooks
yarn add @react-native-community/hooks
```

## API
Expand All @@ -34,7 +34,7 @@ yarn add react-native-hooks
### `useAccessibilityInfo`

```js
import { useAccessibilityInfo } from 'react-native-hooks'
import { useAccessibilityInfo } from '@react-native-community/hooks'

const isScreenReaderEnabled = useAccessibilityInfo()
```
Expand All @@ -44,15 +44,15 @@ const isScreenReaderEnabled = useAccessibilityInfo()
AppState will change between one of 'active', 'background', or (iOS) 'inactive' when the app is closed or put into the background.

```js
import { useAppState } from 'react-native-hooks'
import { useAppState } from '@react-native-community/hooks'

const currentAppState = useAppState()
```

### `useBackHandler`

```js
import { useBackHandler } from 'react-native-hooks'
import { useBackHandler } from '@react-native-community/hooks'

useBackHandler(() => {
if (shouldBeHandledHere) {
Expand All @@ -67,7 +67,7 @@ useBackHandler(() => {
### `useCameraRoll`

```js
import { useCameraRoll } from 'react-native-hooks'
import { useCameraRoll } from '@react-native-community/hooks'

const [photos, getPhotos, saveToCameraRoll] = useCameraRoll()

Expand All @@ -81,7 +81,7 @@ const [photos, getPhotos, saveToCameraRoll] = useCameraRoll()
### `useClipboard`

```js
import { useClipboard } from 'react-native-hooks'
import { useClipboard } from '@react-native-community/hooks'

const [data, setString] = useClipboard()

Expand All @@ -95,7 +95,7 @@ const [data, setString] = useClipboard()
Gets dimensions and sets up a listener that will change the dimensions if the user changes device orientation.

```js
import { useDimensions } from 'react-native-hooks'
import { useDimensions } from '@react-native-community/hooks'

const dimensions = useDimensions()
// or
Expand All @@ -107,7 +107,7 @@ const screen = useDimensions().screen
### `useKeyboard`

```js
import { useKeyboard } from 'react-native-hooks'
import { useKeyboard } from '@react-native-community/hooks'

const keyboard = useKeyboard()

Expand All @@ -118,7 +118,7 @@ console.log('keyboard keyboardHeight: ', keyboard.keyboardHeight)
### `useInteractionManager`

```js
import { useInteractionManager } from 'react-native-hooks'
import { useInteractionManager } from '@react-native-community/hooks'

const interactionReady = useInteractionManager()

Expand All @@ -128,7 +128,7 @@ console.log('interaction ready: ', interactionReady)
### `useDeviceOrientation`

```js
import { useDeviceOrientation } from 'react-native-hooks'
import { useDeviceOrientation } from '@react-native-community/hooks'

const orientation = useDeviceOrientation()

Expand All @@ -139,7 +139,7 @@ console.log('is orientation landscape: ', orientation.landscape)
### `useLayout`

```js
import { useLayout } from 'react-native-hooks'
import { useLayout } from '@react-native-community/hooks'

const { onLayout, ...layout } = useLayout()

Expand All @@ -148,5 +148,5 @@ console.log('layout: ', layout)
<View onLayout={onLayout} style={{width: 200, height: 200, marginTop: 30}} />
```

[version-badge]: https://img.shields.io/npm/v/react-native-hooks.svg?style=flat-square
[package]: https://www.npmjs.com/package/react-native-hooks
[version-badge]: https://img.shields.io/npm/v/@react-native-community/hooks.svg?style=flat-square
[package]: https://www.npmjs.com/package/@react-native-community/hooks
2 changes: 1 addition & 1 deletion package.json
@@ -1,5 +1,5 @@
{
"name": "react-native-hooks",
"name": "@react-native-community/hooks",
"version": "1.1.0",
"description": "",
"main": "lib/index.js",
Expand Down

0 comments on commit 15b0437

Please sign in to comment.