node package manager

reactnative-netinfo-mixin

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>
        );
    }
 
});