Warning: Failed prop type: Invalid prop `source` supplied to `Image`.
See original GitHub issueHi, this repo is really a great improvement for Expo Images. But this warning raised recently.
<CacheImage
preview={getAvatarPlaceholder}
uri={data.creator.photoURL}
style={styles.userPic}/>
export const getAvatarPlaceholder = () => {
return require('../assets/images/avatar-placeholder.png');
};
Warning: Failed prop type: Invalid prop `source` supplied to `Image`.
in Image (at Image.js:92)
in Image (at DiscoverScreen.js:347)
In output, it states that the error happens in Image.js:92 which is about preview.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
React-native failed propType on Image component
You should either require the local assets or use object with uri key. So either in MainComponent : this.state = { images:[ require('....
Read more >invalid prop `rows` of type `object` supplied to `forwardref ...
Warning : Failed prop type: Invalid prop rows of type object supplied to ForwardRef(DataGrid), expected array.` Solution I believe the problem is in...
Read more >[Solved]-React-Native Image Invalid prop 'source' supplied to ...
React error 'Failed propType: Invalid prop `children` supplied to `Provider`, expected a single ReactElement' · React-Native Image Invalid prop 'source' supplied ...
Read more >React Native Community | [SOLVED] Solution is: <Image source
Everthing is working fine, but I've got a warning (both Android & iOS): "Failed prop type: Invalid prop 'source' supplied to Image".
Read more >How to validate React props using PropTypes - LogRocket Blog
Learn how to validate props with React PropTypes, React's internal ... When an invalid value is passed for a prop, a warning is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

If you’re passing a uri string, you’ll want to replace
preview={preview}with
preview={{ uri: preview }}Relevant PR here https://github.com/wcandillon/react-native-expo-image-cache/pull/102
It worked for me, thanks!