New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

is-online-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-online-component

A simple react component that detects online and offline changes

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

is-online-component

npm Build Status

A simple react component that detects online and offline changes

Live demo here

Usage

$ npm install is-online-component
# OR
$ yarn add is-online-component
import React from 'react';
import IsOnline from 'is-online-component ';

const handleChange = (isOnline) => {
  console.log(isOnline);
};

const App = () => (
  <div>
    <IsOnline
      OnlineComponent={<h1>online</h1>}
      OfflineComponent={<h1>offline</h1>}
      onChange={handleChange}
    />
  </div>
);

export default App;

View demo here Edit is-online-component

Props

Following props are used while initialization

Prop NameTypeDescription
OnlineComponent (optional)React.Component or Stringthe component that will be renderized when browser is online
OfflineComponent (optional)React.Component or Stringthe component that will be renderized when browser is offline
onChange (optional)Functionfunction that will be called when the navigator be online or offline

Keywords

FAQs

Package last updated on 20 Jun 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc