generated fromuiwjs/react-monorepo-template
Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
useOnline is a tiny, zero-dependency hook for responding to online/offline changes.
License
NotificationsYou must be signed in to change notification settings
uiwjs/react-use-online
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
useOnline is a tiny, zero-dependency, SSR hook for responding to online/offline changes.
npm install @uiw/react-use-online
You can use the Chrome Browser Debug Tool(f11) to set upoffLine andonLine test hooks.
importReactfrom"react";import{useOnline}from'@uiw/react-use-online';exportdefaultfunctionApp(){constisOnline=useOnline();return(<div><h1style={{margin:0}}>useOnline</h1><div>{isOnline ?'✅ You are online' :'❌ You are offline'}</div></div>);}
- useColorScheme
useColorScheme()is a tiny, zero-dependency, SSR hook for responding to devices color scheme changes.
As always, thanks to our amazing contributors!
Made withcontributors.
Licensed under the MIT License.
About
useOnline is a tiny, zero-dependency hook for responding to online/offline changes.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.