Black Friday Sale Upgrade Your Home →

Pass Data Between Screens

Pass Data Between Screens when Navigating with StackNavigator

Once navigation is setup, we’ll pass data between screens using params.

Passing navigation props

Sometimes we need to pass additional props to another screen - such as an id for the selected item. Parameters can be passed as the second argument to the navigate() function.

this.props.navigation.navigate('Info', {
place: this.state.place
})

Inside the Info screen we can now access the params on the navigation prop.

JSX
this.props.navigation.getParam('place')

🐦   Previous   💼   Next