Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netinfo error #166

Open
hustlercoder opened this issue Jul 15, 2019 · 11 comments
Open

Netinfo error #166

hustlercoder opened this issue Jul 15, 2019 · 11 comments

Comments

@hustlercoder
Copy link

Hi there i had an issue with the library.I think it can be related to the fact that netinfo library is not part of the standard react library anymore so the api has changed.
The caching process fail with error: Netinfo.isConnected undefined.

@glCoder8
Copy link

I think networkAvailable flag is not used anywhere, so you can remove NetInfo?
Please let me know your opinion @fungilation.

@hustlercoder
Copy link
Author

@glCoder8 i use Netinfo.isConnected....but it undefined....not networkAvailable

@glCoder8
Copy link

@hustlercoder I mean, react-native-cached-image component using NetInfo for setting networkAvailable state value, but it's not used anywhere.

and I think you are getting error because you are using higher level of NetInfo package (maybe 3.x.x), but react-native-cached-image using NetInfo package 2.0.3.

to get rid of your issue, you need to use same version of NetInfo in your project, so it should be 2.0.3

@elhachimi
Copy link

@hustlercoder you are right , i have this issue as well, this module is still using NetInfo from react-native,
here

const {
    View,
    ImageBackground,
    ActivityIndicator,
    NetInfo,
    Platform,
    StyleSheet,
} = ReactNative;

Which is not correct because NetInfo got removed to it's own repo https://github.com/react-native-community/react-native-netinfo
this is why when i upgraded to react-native 0.60.10 i'me getting :
TypeError: Cannot read property isConnected of undefined

@orcunorcun
Copy link

Is there any fixes?

@hustlercoder
Copy link
Author

@orcunorcun i think no...anyway i will try another package because for now there is nothing to do...

@OtacilioN
Copy link

I got the same error =/

@russelRajitha
Copy link

same issue. is there any fix for this issue?

@orcunorcun
Copy link

I think they forgot that library. So someone should create a new npm package :/

@wandhi
Copy link

wandhi commented Sep 25, 2019

you must change
const {
View,
ImageBackground,
ActivityIndicator,
NetInfo,
Platform,
StyleSheet,
} = ReactNative;

to

const {
View,
ImageBackground,
ActivityIndicator,
Platform,
StyleSheet,
} = ReactNative;

const NetInfo = require('@react-native-community/netinfo');
in node-module/react-native-cached-image/CachedImage.js

@hueyAtFetchly
Copy link

you must change
const {
View,
ImageBackground,
ActivityIndicator,
NetInfo,
Platform,
StyleSheet,
} = ReactNative;

to

const {
View,
ImageBackground,
ActivityIndicator,
Platform,
StyleSheet,
} = ReactNative;

const NetInfo = require('@react-native-community/netinfo');
in node-module/react-native-cached-image/CachedImage.js

Another for https://github.com/ds300/patch-package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants