You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I Implemented effectiveConnectionType to detect the network signal strength. When I call the function may be its going in infinite loop and returning following error in console:
Its going multiple times in switch cases. This is my function:
const MeasureConnectionSpeed = () => {
const { effectiveConnectionType } = useNetworkStatus();
switch(effectiveConnectionType) {
case 'slow-2g':
setNetworkStrength("WEAK");
break;
case '2g':
setNetworkStrength("OKAY");
break;
case '3g':
setNetworkStrength("GREAT");
break;
case '4g':
setNetworkStrength("EXCELLENT");
break;
default:
break;
}
}
MeasureConnectionSpeed();