bongjuri1551
bongjuri1551

Reputation: 31

How do I get parameters of the Navigation AppContainer?

I've received the Id as an Appcontainer from another navigation.

How can I get each received Id on the StackNavigation screen?

const Parent = createStackNavigator(
  {
    User: User, // <----- I want to bring Id to this screen.
    Noti: Noti,

  },
  {
      initialRouteName: 'User',
      defaultNavigationOptions: ({navigation}) => ({

      headerStyle: {
        backgroundColor: '#004680',
      },
      headerTintColor: '#fff',
      headerTitleStyle: {
        fontSize:20,
      },
    }),
  }
);

const AppContainer = createAppContainer(Parent);

export default class App extends React.Component {

  render() {
     return <AppContainer id={this.props.id} />; // <----- When I printed this value, it correctly.

  }
}

Upvotes: 1

Views: 44

Answers (0)

Related Questions