Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with nested navigation #1

Open
uwemneku opened this issue Dec 30, 2021 · 0 comments
Open

Problem with nested navigation #1

uwemneku opened this issue Dec 30, 2021 · 0 comments
Assignees

Comments

@uwemneku
Copy link
Owner

Due to the navigation structure of the app, there's is an issue when users navigate from the root navigator into the sharedElementNavigator which is nested inside the bottom tab navigation.

Navigation Structure

export type RootParamList = {
    main: NavigatorScreenParams<BottomTabParamList>
    search: undefined
}
export type BottomTabParamList = {
    BottomTabHome: NavigatorScreenParams<SharedScreenParamList>
    Settings: undefined;
    Cart: undefined;
    Bookmarks: undefined;
}
export type SharedScreenParamList = {
    bookDetails: StoredMovies
    Home: undefined;
}

When users navigate from "bookmarks" to "bookDetails" screen, the app has to first navigate to the bottom tabs and then navigate to the shared screens. Therefore the navigation array will be

//because bookDetails is nested inside BottomTabHome
const navigationState = ["bookmarks", "BottomTabHome", "bookDetails"]

This means that when users navigate backward, instead of mounting the bookDetails screen, it moves back to the bottom tab navigator and when we press the back button again we are returned to the bookmarks screen

image example

@uwemneku uwemneku self-assigned this Dec 30, 2021
@uwemneku uwemneku pinned this issue Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant