native,
here I take the value from the first page.
constructor(){
super();
this.state = {
selectPickup:'',
}
}
ongNavigationDetail = ()=>{
let params = {
pickup : this.state.selectPickup
}
console.log(params)
// send to third page
}
render() {
const userLocation = this.props.navigation.getParam('pickup'); // get value from first page
return (
<CardItem header>
{/* <Text style={{ fontSize: 12}}>{userLocation}</Text> */}
<Input onChangeText={userLocation => this.setState({selectPickup:userLocation})} value={userLocation}/>
</CardItem>
<Button block info style={styles.MainBtn} onPress={this.ongNavigationDetail}>
<Text style={styles.btnText}>Next</Text>
</Button>
)}
on the second page, here I take the value userLocation to send a third trip but when I console the value is undifined, where is the explosion?
I think currently, your navigation object doesn't have access to getParams
function. Maybe you can access it simply like this.
this.pros.navigation.route.params