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 has been removed from react-native #182

Open
ilibilibom opened this issue Dec 16, 2019 · 8 comments
Open

netinfo has been removed from react-native #182

ilibilibom opened this issue Dec 16, 2019 · 8 comments

Comments

@ilibilibom
Copy link

Hi
When calling CachedImage I'm getting the following error:

netinfo has been removed from react-native

This is my code:
<CachedImage
source={{uri: imageUrl}}
style={{flex: 1, width: null, height: null}}
/>

@cyberdude
Copy link

This one is important

@hardikramoliya
Copy link

hardikramoliya commented Dec 20, 2019

Facing same issue when add react-native-cached-image
Invariant Violation: NetInfo has been removed from React Native. It can now be installed and imported from 'react-native-netinfo' instead of 'react-native'.

@ilibilibom
Copy link
Author

@hardikramoliya - sadly this library didn't work for me.
This one did:
https://github.com/DylanVann/react-native-fast-image

@prakashw3expert
Copy link

prakashw3expert commented Dec 23, 2019

In file CachedImage.js
remove import of NetInfo from react native to.

import NetInfo from "@react-native-community/netinfo";

@hueyAtFetchly
Copy link

hueyAtFetchly commented Aug 26, 2020

In file CachedImage.js
remove import of NetInfo from react native to.

import NetInfo from "@react-native-community/netinfo";

Is there a PR in? Can you please reference if so?

Right now using https://github.com/ds300/patch-package to remedy

@DeniferSantiago
Copy link

I am still waiting for a solution for this 😕

@hueyAtFetchly
Copy link

Denifer please use @prakashw3expert 's answer.

Ideally you can use https://github.com/ds300/patch-package to create a patch that will be reapplied after each reinstall of react-native-cached-image

@prakashw3expert
Copy link

@DeniferSantiago Open react-native-cached-image from node modules
You need To change manually into this library
Open CachedImage.js
Remove Netinfo from react native
You need to import NetInfo from “@react-native-community/netinfo”; from this
and one more you have to do in it
open utils folder and change const RNFetchBlob = require(‘react-native-fetch-blob’).default; to
import RNFetchBlob from ‘rn-fetch-blob’;
This is only solution of this issue

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

6 participants