New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-neti

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-neti

This tool was created using react hooks, typescript and bundled using rollup to handle network connectivity checks.It uses polling to check the network connectivity status of your device in real time.

latest
npmnpm
Version
1.2.71
Version published
Maintainers
1
Created
Source

react-neti

This tool was created using react hooks, typescript and bundled using rollup to handle network connectivity checks.It uses polling to check the network connectivity status of your device in real time.

New in version 1.2.71

=== support for cjs module ===

Github repository

Example

Hooks

import React from "react";
import { useConnection } from "react-neti";

export const App = () => {
  // pollingIntreval optional parameter
  const { connection } = useConnection({ pollingIntreval: 1000 });
  return <div>{connection ? "Online" : "Offline"}</div>;
};

Components

//  Accept pollingIntreval prop
import React from "react";
import { OnlineWrapper, OfflineWrapper } from "react-neti";
export const App = () => {
  return (
    <>
      <OnlineWrapper>
        I will appear only when there is internet connection available
      </OnlineWrapper>
      <OfflineWrapper>
        I will appear only when there is no internet connection
      </OfflineWrapper>
    </>
  );
};

Styling and props

// Accept pollingIntreval prop
// children can be component | number | string
return (
  <div>
    <OnlineWrapper style={...your - style} className="your className">
      <YourComponent />
    </OnlineWrapper>
  </div>
);

Keywords

react

FAQs

Package last updated on 22 Aug 2022

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