Passing Data Using React-Native Navigation

后端 未结 7 2115
野性不改
野性不改 2020-12-16 13:30

Im trying to pass data between screens in my app. Currently I am using


\"react-native\": \"0.46.0\",
\"react-navigation\": \"^1.0.0-beta.11\"
<         


        
7条回答
  •  盖世英雄少女心
    2020-12-16 14:28

    In your code, props.navigation and this.props.navigation.state are two different things. You should try this in your second screen:

    const {state} = props.navigation;
    console.log("PROPS " + state.params.user);
    

    the const {state} line is only here to get an easy to read code.

提交回复
热议问题