React-native-image-picker: Error while updating property "src" of a view managed by: RCTImageView

Created on 21 Nov 2017  路  3Comments  路  Source: react-native-image-picker/react-native-image-picker

Description

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.

Code:

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)

Additional Information

  • React Native version: 0.50.1
  • Platform: only tried Android.
  • Development Operating System: Linux
stale

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akishek22 picture akishek22  路  3Comments

emmaielle picture emmaielle  路  4Comments

kariasbolster picture kariasbolster  路  3Comments

ozergul picture ozergul  路  3Comments

Gnative picture Gnative  路  3Comments