reactnative-netinfo-mixin
v1.0.6
Published
Update state of component to pass NetInfo value isConnected
Downloads
2
Readme
This Mixin define a state NetInfo for your component
Install
$ npm i --save reactnative-netinfo-mixin
Usage
import React from 'react';
import { View, Text } from 'react-native';
import NetInfoMixin from 'reactnative-netinfo-mixin';
const MyComponent = React.createClass({
mixins: [ NetInfoMixin ],
render() {
return (
<View>
<Text>{ this.state.NetInfo.isConnected ? 'online' : 'offline' }</Text>
</View>
);
}
});