Internet Connection Alert For React Native

Author:WrathChaos
Views Total:10 views
Official Page:Go to website
Publish Date:September 1, 2020
License:MIT

A fully customizable React Native component to detect internet connection and display an alert if the connection is offline.

Install & Import:

# NPM
$ npm i react-native-internet-connection-alert --save
import InternetConnectionAlert from "react-native-internet-connection-alert";

Basic Usage:

<InternetConnectionAlert
  onChange={(connectionState) => {
    console.log("Connection State: ", connectionState);
  }}
>
</InternetConnectionAlert>

Available props:

// "info" | "warn" | "error" | "custom" | "success"
type: DropdownAlertType;

// alert title
title: string;

// alert message
message: string;

// interval
interval?: number;

// callback
onChange: (state: NetInfoState) => void;

Preview:

Internet Connection Alert For React Native

You Might Be Interested In:

Leave a Reply