1.2.71 • Published 2 years ago

react-neti v1.2.71

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago