Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
react-detect-offline
Advanced tools
Components that track offline and online state. Render certain content only when online (or only when offline).
import { Offline, Online } from 'react-detect-offline';
const App = () => (
<div>
<Online>Only shown when you're online</Online>
<Offline>Only shown offline (surprise!)</Offline>
</div>
);
Check out chris.bolin.co/offline for a simple example (source code). As in this example, react-detect-offline
pairs well with create-react-app
, which creates offline-ready React apps out of the box.
<Online/>
- Component that renders its children only when the browser is online.
<Offline/>
- Component that renders its children only when the browser is not online.
Note: Online
and Offline
are mutually exclusive; if one is rendering, the other will not be.
The web spec we rely on is supported by IE 9+, Chrome 14+, Firefox 41+, and Safari 5+ - that's 94% of worldwide (98% of US) browser traffic.
Offline
to remind users they might need to connect to complete certain actions.Online
to let readers know the page is available offline.Online
to hide links or other content that is irrelevant when offline.FAQs
Offline and Online components for React
The npm package react-detect-offline receives a total of 10,404 weekly downloads. As such, react-detect-offline popularity was classified as popular.
We found that react-detect-offline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.