Reputation: 117
I want to pass one array from first view to second view in react native. So how can I achieve this in react native ? For navigation I am using 'react-navigation'.
this.navigation.navigateWithDebounce('BlaBlaView', {title: 'BlaBla View'}).
Upvotes: 1
Views: 2096
Reputation: 6006
If your'e using react-navigation's naviagte
. you can pass the parameters as the second parameter, for instance:
this.props.navigation.navigate(`ROUTE_NAME`, { params: 'param value' });
And then, within the view you navigated to you can access it:
componentWillMount() {
const { param } = this.props.navigation.state.params;
}
Upvotes: 3