react-native-cached-image icon indicating copy to clipboard operation
react-native-cached-image copied to clipboard

netinfo has been removed from react-native

Open ilibilibom opened this issue 5 years ago • 8 comments

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}} />

ilibilibom avatar Dec 16 '19 09:12 ilibilibom

This one is important

cyberdude avatar Dec 17 '19 11:12 cyberdude

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'.

hardikramoliya avatar Dec 20 '19 16:12 hardikramoliya

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

ilibilibom avatar Dec 20 '19 17:12 ilibilibom

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

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

prakashw3expert avatar Dec 23 '19 06:12 prakashw3expert

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

hueyAtFetchly avatar Aug 26 '20 18:08 hueyAtFetchly

I am still waiting for a solution for this 😕

DeniferSantiago avatar Sep 03 '20 20:09 DeniferSantiago

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

hueyAtFetchly avatar Sep 03 '20 23:09 hueyAtFetchly

@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

prakashw3expert avatar Sep 04 '20 06:09 prakashw3expert