Skip to content

prepare for RNC #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-native-hooks",
"name": "@react-native-community/hooks",
"version": "1.1.0",
"description": "",
"main": "lib/index.js",
Expand Down