@Vinzzz is right best solution is to use redux. But here how you can make this work without it.
When you navigate to another view you call action.OTHER_VIEW()
You can pass parameters to this function, which will be available via props in the component corresponding to your key : "OTHER_VIEW"
Here an example :
routeA.js
constructor(props){
super(props);
var _data = this.props.dataFromRouteB || "";
this.state = {
data : _data
};
}
onPress(){
action.ROUTE_B({dataFromRouteA: this.state.data}); // navigate to route B
}
render(){
const {data} = {...this.state};
return(
<View>
<Text>{data}</Text>
<Button title="go to route B" onPress={()=> this.onPress()} />
</View>
);
}
routeB.js
componentDidMount(){
var a = this.props.dataFromRouteA; // a = ""
a = "hello";
action.ROUTE_A({dataFromRouteB:a}); // navigate to ROUTE_A , data will be available via props
}