Skip to content Skip to sidebar Skip to footer

Sending States Between Screens React Native

Am currently working with an app that will provide you with a class/race/background story from an fantasy api. I used expo's tab template when i created the project. So my question

Solution 1:

When you navigate from one screen to another as follows:

this.props.navigation.navigate('ContactDisplay', { item });

You may access 'item' in the other screen as follows:

console.log(this.props.navigation.state.params.item);

Solution 2:

Not sure if I understand your question, but, first of all, you always pass props between components, not states, which only exists within each component, so perhaps you can take a look at Passing parameters to routes


Post a Comment for "Sending States Between Screens React Native"