If you are using react-navigation for routing from one component to another,
it's pretty simple to send data in params as you move to a new component. Have a look at the docs here.
In your android.js
file, initialize all the routes like below:
import Component from './app/components/Component/Component';
import HomeComponent from './app/components/HomeComponent/HomeComponent';
const Mobile = StackNavigator(
{Login: { screen: Component },
Home: { screen: HomeComponent },},
{ initialRouteName: 'Login' },
{ headerMode: 'screen' });
AppRegistry.registerComponent('Mobile', () =>Mobile);
Then the login screen will load first, then use this command in a function or constructor to navigate:
this.props.navigation.navigate('Home',{param:'SomeParameter'})
In the Home screen constructor print out the this.props
, and in the console you will find the param key in that object.