diff --git a/README.md b/README.md
index d139081..cfa0eee 100644
--- a/README.md
+++ b/README.md
@@ -16,8 +16,6 @@
[download-url]: https://npmjs.org/package/react-native-ping
[license-image]: https://img.shields.io/npm/l/react-native-ping.svg
-
-
## Getting started
`$ npm install react-native-ping --save`
@@ -60,8 +58,54 @@ or
## Usage
```javascript
-import RNReactNativePing from 'react-native-ping';
+import Ping from 'react-native-ping';
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ backgroundColor: '#F5FCFF'
+ },
+ buttonText: {
+ fontSize: 24,
+ padding: 32
+ },
+ msText: {
+ fontSize: 24,
+ padding: 32
+ }
+});
// TODO: What to do with the module?
-RNReactNativePing;
+export default class App extends Component {
+ state = {
+ ipAddress: '114.114.114.114',
+ ms: ''
+ };
+ onPressButton = async () => {
+ const ms = await Ping.start('114.114.114.114');
+ this.setState({ ms });
+ };
+ render() {
+ return (
+
+ this.setState({ ipAddress })}
+ value={this.state.ipAddress}
+ />
+
+ Ping
+
+ ms:{this.state.ms}
+
+ );
+ }
+}
```
diff --git a/example/App.js b/example/App.js
index dc073d6..7a32319 100644
--- a/example/App.js
+++ b/example/App.js
@@ -52,7 +52,7 @@ export default class App extends Component {
borderWidth: 1,
alignSelf: 'stretch'
}}
- onChangeText={text => this.setState({ ipAddress })}
+ onChangeText={ipAddress => this.setState({ ipAddress })}
value={this.state.ipAddress}
/>
diff --git a/package.json b/package.json
index bec8c98..3ba7959 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-ping",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "Highly accurate ICMP Ping controller for React Native",
"main": "index.js",
"scripts": {