react-redux-internet-connection
Check internet connection from your redux's state
Installation
npm:
npm install react-redux-internet-connection
yarn:
yarn add react-redux-internet-connection
Config
In your main reducers
;; const rootReducer = ;;
And you just need to add ReactReduxInternetConnection
in App.js
;; { return <div className="App"> <h1>react-internet-connection</h1> <ReactReduxInternetConnection /> </div> ; } ;
Usage
;;; // you can access in every where to internet connection :)@ static propTypes = connection: PropTypesbool ; { const connection = thisprops; return <div> connection && <h1>connected :)</h1> !connection && <h1>disconnected :</h1>} </div> ; }