I followed React Navigation Doc to pass params to my previous screen, but i'm getting error when acces it in my previous screen saying
evaluating this.props.route.params.text
export default class SelectMap extends Component{
constructor() {
super()
}
render(){
const {text} = this.props.route.params
return (
<View style={{alignItems: 'center', justifyContent:'center'}}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('MapView')}>
<Text>
Open Maps
</Text>
<Text>
{text}
</Text>
</TouchableOpacity>
</View>
)
}
}
This is how i sent the params
this.props.navigation.navigate('SelectMap', {text:JSON.stringify(this.state.marker)})