Categories
React Native Answers

How to pass parameters to nested navigators with React Native?

Spread the love

To pass parameters to nested navigators with React Native, we call navigation.navigate with an object with the params property.

For instance, we write

navigation.navigate('Account', {
  screen: 'Settings',
  params: { user: 'jane' },
});

to set the params property to an object with the data that we want to pass to the destination component.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *