Shubham Chopra
Shubham Chopra

Reputation: 1737

How to know if a user is connected to cellular network or wifi using reactjs

Is there any way or package which I can use to detect to whether user is on WiFi or using cellular network.

Upvotes: 1

Views: 819

Answers (1)

Subhendu Kundu
Subhendu Kundu

Reputation: 3856

You might want to try

const networkInformation = navigator.connection;
console.log(networkInformation);

For more info try https://developer.mozilla.org/en-US/docs/Web/API/Navigator/connection

Worth looking at Determine user's internet connection type via javascript or jquery as well.

Upvotes: 2

Related Questions