I am trying to pass the state data from App.js to my drawer screen which is located at a different file but the props unable to retrieve the data.
App.js
render() {
return (
<GalioProvider theme={argonTheme}>
<Block flex>
<Screens user={this.state.user} />
</Block>
</GalioProvider>
);
}
Screen.js
const AppStack = createDrawerNavigator(
{
Home: {
screen: HomeStack,
navigationOptions: (navOpt) => ({
drawerLabel: ({ focused }) => (
<DrawerItem focused={focused} title="Home" />
),
}),
},
},
{
contentComponent: (props) => {
console.log(props.user);
return (
<View
style={{ flex: 1, alignItems: "center", justifyContent: "center" }}
></View>
);
},
}
);
const AppContainer = createAppContainer(AppStack);
export default AppContainer;
The console.log(props.user) line is returning undefined