Maintain state.params between react-navigation tabs

I am creating an app with react-react and react. The problem is that when I go to the TabNavigator view, switching between tabs erases the navigation options for the TabNavigator scene. I want to keep the same navigation options for all tabs.

Here is my setup. It starts with Home

TabNavigator. If they click on a person PeopleList

, then I move on to Person

TabNavigator, calling: this.props.navigation.navigate("Person",{person:person})

. This defaults to the scene Info

correctly with the correct parameters. However, when I click on the tab PersonPurchases

, the parameter Person

is removed from the nav state.

const MyApp = StackNavigator({
    Home: {screen:TabNavigator({
        PeopleList: { screen: PeopleListScene },
        Calendar: { screen: CalendarScene },
        TasksList: { screen: TasksScene },
    })},
    Person: {screen:TabNavigator({
        PersonInfo: { screen: PersonInfoScene },
        PersonPurchases: { screen: PersonPurchasesScene }
    },{tabBarOptions:{ tabBarPosition:"bottom", backBehavior:"none"})}
})

      

Any idea how to prevent this?

+3
reactjs react-native react-navigation


source to share


No one has answered this question yet

Check out similar questions:

1203
Navigate programmatically with responsive router
36
Resetting the navigation stack for the main screen (React Navigation and React Native)
3
React Navigation with nested navigators not refreshing screens
0
react-navigation doesn't show screen added in StackNavigator
0
React Native - tab + drawer navbar issue
0
Prevent navigation when changing react-navigation parameters
0
React Navigation V2 Hide individual tab from bottom Navigator tab
0
Nested navigators in interactive navigation mode and navigation between internal and external
0
Change nav navigator position



All Articles
Loading...
X
Show
Funny
Dev
Pics