Open abeltje1 opened 7 years ago
@abeltje1 Hey, thanks for this! I can't investigate right now, can you provide some more info?
Thanks
I'm also hitting this issue after upgrading to the latest React Native. I had to replace all instances of
@abeltje1 @alxvallejo Can you make sure you are requiring the component correctly please.
// Should be something like this:
import {
CachedImage
} from 'react-native-cached-image';
// Or this
const CachedImage = require('react-native-cached-image').CachedImage;
@kfiroo yes I'm doing it exactly that way. Precisely what extra info are you looking for? I can't really figure out what there is more to show, sorry :p
@abeltje1 I'm trying to find what's different about your setup, where it looks like one of the components is resolved to an object
, from mine and others where everything seems to work fine :)
Anything you can give me could be helpful.
Can you run the CachedImageExample
? Are you getting the same errors?
@kfiroo I think the library should export the default CachedImage component, so as to keep compatibility and make the upgrading path smooth.
@kfiroo I will look into it tomorrow, hope to give you some more info!
Having the same issue.
Same issue, don't have any update information available though.
If it helps any, installing version 1.3.5 works fine So something has changed since then to cause this issue.
I'm using RN 0.49.3, works for me, could you share how you import and use CachedImage?
Please make sure you are requiring the component as suggested in this comment https://github.com/kfiroo/react-native-cached-image/issues/88#issuecomment-332667016
To be specific... make sure you are adding the {} around CachedImage.
Old way:
import CachedImage from 'react-native-cached-image';
New way:
import {CachedImage} from 'react-native-cached-image';
Although now that I just changed all mine I am running into a new error...
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.
Check the render method of CachedImage.
After I've upgraded to 0.48.4 (latest RN atm) sadly this library broke, it's giving me the following error message:
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
When I remove all CachedImage tags for regular RN Image tags, everything works again. I'm running on the latest react-native-cached-image (0.4). Anyone an idea how to solve?
Cheers