我正在使用 React navigation 6 和包含选项卡导航器的根堆栈导航器。我的链接属性配置在应用程序组件中如下所示:
export default function App() {
const linking = {
prefixes: [prefix],
config: {
screens: {
Roundups: 'roundups',
Account: 'account',
TabNavigator: {
screens: {
Tab1: 'tab1',
Tab2: 'tab2',
},
},
},
},
};
return (
<NavigationContainer linking={linking} fallback={<Text>Loading...</Text>}>
<QueryClientProvider client={queryClient}>
<Stack.Navigator>
<Stack.Screen name="RoundUps" component={RoundUps} />
<Stack.Screen name="Account" component={Account} />
<Stack.Screen name="LoggedIn" component={TabNavigator} />
</Stack.Navigator>
</QueryClientProvider>
</NavigationContainer>
);
}
Run Code Online (Sandbox Code Playgroud)
我的 TabNavigator 组件如下所示:
const Tab = createBottomTabNavigator();
type Props = NativeStackScreenProps<RootStackParamList, 'TabNavigator'>;
const TabNavigator = ({ navigation }: …
Run Code Online (Sandbox Code Playgroud) 我已按照本指南构建了Angular 6库模块,并在库中运行了一个虚拟应用程序,因此我可以在开发过程中导入和测试模块。
我从库中导入的库模块具有子路由。我认为这是此问题的根本原因。双关打算。库模块的路由模块如下所示:
// Library Module routing
const routes: Routes = [{
path: '',
children: [
{ path: '', component: LoginFormComponent },
{ path: 'forgot-password', component: ForgotPasswordFormComponent }
]
}];
@NgModule({
imports: [ RouterModule.forChild(routes) ],
exports: [ RouterModule ]
})
export class LoginRoutingModule {}
Run Code Online (Sandbox Code Playgroud)
在我的虚拟应用程序中,我有一个模块模块,由应用程序路由模块延迟加载:
// Dummy app root routing
const appRoutes: Routes = [
{
path: '',
children: [{
path: 'modules',
loadChildren: './modules/modules.module#ModulesModule'
}]
},
{ path: '**', redirectTo: '' }
];
@NgModule({
imports: [RouterModule.forRoot(appRoutes)],
exports: [RouterModule] …
Run Code Online (Sandbox Code Playgroud) angular ×1
angular6 ×1
expo ×1
ng-packagr ×1
node-modules ×1
react-native ×1
routes ×1
typescript ×1