NetInfo in react-native is returning isConnected as false even when network is connected -


we using react-native netinfo in following way.

export default class networkstatus extends react.purecomponent {  constructor(props){   super(props);     netinfo.addeventlistener(      'change',      this.onconnectivitychange   );   }   onconnectivitychange = (status) => {    netinfo.isconnected.fetch().then(isconnected => {      console.log('*********network status ' + (isconnected ? 'online' :      'offline'));  }); } 

launched app in offline mode. got following console.

*********network status offline.

then turned on wifi , connected. got offline console twice.

*********network status offline.

*********network status offline.

is bug in netinfo library. there way fix it.

versions used :

"react": "16.0.0-alpha.6"

"react-native": "0.44.0",

i had given answer in else's question

the link here:- here

please refer if like.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -