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

Linking path assertion needs to account for nested screens. #10857

Open
11 tasks
EvanBacon opened this issue Sep 17, 2022 · 1 comment
Open
11 tasks

Linking path assertion needs to account for nested screens. #10857

EvanBacon opened this issue Sep 17, 2022 · 1 comment

Comments

@EvanBacon
Copy link
Sponsor Contributor

Current behavior

If you have an app with routes /home and /profile, each with their own navigator, then you'll get a collision error on the navigators.

Here is the linking configuration:

{
    "prefixes": [
        "http://localhost:19000/"
    ],
    "config": {
        "screens": {
            "(stack)": {
                "path": "",
                "screens": {
                    "home": {
                        "path": "home"
                    }
                }
            },
            "(tab)": {
                "path": "",
                "screens": {
                    "profile": {
                        "path": "profile"
                    }
                }
            }
        }
    }
}

(stack) and (tab) both technically match /, but due to the nested children / can never be matched. Commenting our this assertion fixes the issue, meaning we probably need to update the check to account for screens.

Expected behavior

A user should be able to navigate to /profile and /home given the above configuration.

Reproduction

https://snack.expo.dev/@bacon/conflicting-screen-bug

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/​bottom-tabs
  • @react-navigation/​drawer
  • @react-navigation/​material-bottom-tabs
  • @react-navigation/​material-top-tabs
  • @react-navigation/​stack
  • @react-navigation/​native-stack

Environment

@react-navigation/native: ^6.0.12 (latest)

@EvanBacon EvanBacon added the bug label Sep 17, 2022
@github-actions
Copy link

Couldn't find version numbers for the following packages in the issue:

  • @react-navigation/native

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant