kfiroo / react-native-cached-image

CachedImage component for react-native
MIT License
938 stars 470 forks source link

netinfo has been removed from react-native #182

Open ilibilibom opened 4 years ago

ilibilibom commented 4 years ago

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 commented 4 years ago

This one is important

hardikramoliya commented 4 years ago

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 commented 4 years ago

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

prakashw3expert commented 4 years ago

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

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

hueyAtFetchly commented 3 years ago

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 commented 3 years ago

I am still waiting for a solution for this 😕

hueyAtFetchly commented 3 years ago

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 commented 3 years ago

@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