React Navigation v6 - 与嵌套导航器的深度链接

问题描述 投票:0回答:0

我正在尝试通过魔术链接添加登录。我已经为 iOS 和 Android 设置了深层链接配置,应用程序打开了,但是我很难让它打开相应的屏幕。我试图打开的屏幕是这样嵌套的:

Root (Stack Navigator)
  └── Tabs (Bottom Tab Navigator)
        ├── ProfileTab (Stack Navigator)
        │     └── MagicLinkSent (Screen)
        └── Other Tabs...

我目前的配置设置如下:

export const linking = {
  prefixes: ['appname://'],
  config: {
    screens: {
      Tabs: {
        initialRouteName: 'ProfileTab',
        screens: {
          ProfileTab: {
            initialRouteName: 'MagicLinkSent',
            screens: {
              MagicLinkSent: 'auth/v1/magic',
            },
          },
        },
      },
      NotFound: '*',
    },
  },
};

但是我收到这个错误

The navigation state parsed from the URL contains routes not present in the root navigator. This usually means that the linking configuration doesn't match the navigation structure.

我已经点击了文档链接,但无法弄清楚我做错了什么。

react-native react-navigation deep-linking
© www.soinside.com 2019 - 2024. All rights reserved.