Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Repository files navigation

Build & DeployCoverage StatusNPM Versionreact@^18

useOnline is a tiny, zero-dependency, SSR hook for responding to online/offline changes.

Quick Start

npm install @uiw/react-use-online

Using

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

Related

  • useColorSchemeuseColorScheme() is a tiny, zero-dependency, SSR hook for responding to devices color scheme changes.

Contributors

As always, thanks to our amazing contributors!

Made withcontributors.

License

Licensed under the MIT License.

About

useOnline is a tiny, zero-dependency hook for responding to online/offline changes.

Resources

License

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    [8]ページ先頭

    ©2009-2025 Movatter.jp