I am getting the error:
Error while updating property "src" of a view managed by: RCTImageView
, which is caused by the uri, which requires a string, but is receiving an object. However when I log profilePicture, I get a string.
const Header = (profilePicture, profile) => (
<View style={styles.header}>
<Image
style={styles.cornerLogo}
source={require("../../images/logoCorner.png")}
/>
<TouchableOpacity onPress={() => profile} activeOpacity = {0.6}>
<Image
style={styles.profilePicture}
source={{uri: profilePicture}}
/>
</TouchableOpacity>
</View>
)
Header.propTypes = {
profilePicture: PropTypes.string.isRequired,
profile: PropTypes.func.isRequired
}
function mapStateToProps(state){
console.log("PROFILEPIC::::", state.profile.get("profilePicture"));
return {
profilePicture: state.profile.get("profilePicture"),
};
}
function mapDispatchToProps(dispatch){
return {
profile: () => {
dispatch(NavigationActions.navigate({ routeName: "Profile" }))
},
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Header)
I resolve with
<Image
style={styles.backgroundImage}
source={require('./bg-user.jpg')}
/>
image local not use property 'uri';
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.