Skip to content

Commit

Permalink
update readme.md detect network, installation react-native
Browse files Browse the repository at this point in the history
  • Loading branch information
morrys committed Jun 12, 2019
1 parent 10cdb4a commit c0cd3ee
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@

React Relay Offline is a extension of [Relay](https://facebook.github.io/relay/) for offline capabilities

## Installation
## Installation React Web

Install react-relay and react-relay-offline using yarn or npm:

```
yarn add react-relay react-relay-offline
```

## Installation React Native

Install react-relay and react-relay-offline using yarn or npm:

```
yarn add @react-native-community/netinfo react-relay react-relay-offline
```

You then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project:

`react-native link @react-native-community/netinfo`


## React Web Example

Expand Down Expand Up @@ -134,6 +146,13 @@ import { QueryRenderer } from 'react-relay-offline';
import { commitMutation, graphql } from 'react-relay-offline';
```
## Detect Network
```ts
import { useIsConnected } from "react-relay-offline";
import { useNetInfo } from "react-relay-offline";
```
## Requirement
* Version 3.0.0 or 4.0.0 of the react-relay library
Expand Down

0 comments on commit c0cd3ee

Please sign in to comment.