1

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'}).

1 Answer 1

3

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;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Perfect answer....Thanks..:) Just add the 'param' after the 'params'......this.props.navigation.state.params.param

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.