check-user-network-status
v1.0.3
Published
React hook to check network status is online or offline.
Downloads
2
Maintainers
Readme
Check Internet connection
Using this package you can get status of user's internet connection.
Just Import the package.
Install
npm i check-user-network-status
◎ Import
import useNetworkStatus from 'check-user-network-status';
◎ Usage
function App() {
const networkStatus = useNetworkStatus();
if(networkStatus===false) return <h1>Looks like you are offline</h1>
}
◎ Example
import useNetworkStatus from 'check-user-network-status';
function App() {
const networkStatus = useNetworkStatus();
if(networkStatus===false) return <h1>Looks like you are offline</h1>
return (
<div className="App">
<h1>Hello World</h1>
</div>
);
}