From 719c714f5522426d8dd50a6592017d2a9fdf0ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LuoHao=5B=E7=BD=97=E6=B5=A9=5D?= Date: Wed, 21 Nov 2018 10:35:27 +0800 Subject: [PATCH] bump version --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++---- example/App.js | 2 +- package.json | 2 +- 3 files changed, 50 insertions(+), 6 deletions(-) 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": {