无法复制功能



当我尝试复制函数时显示RootNavigator错误

重复函数实现。ts(2393)

我试着在顶部添加export,但是行不通

export {}

https://reactnavigation.org/docs/native-stack-navigator选项
const DashboardStack = createNativeStackNavigator<RootStackParamList>();
function RootNavigator() {
return (
<DashboardStack.Navigator>
<DashboardStack.Screen name="Root" component={BottomTabNavigator} options={{ headerShown: false }} />
<DashboardStack.Screen name="NotFound" component={NotFoundScreen} options={{ title: 'Oops!' }} />
<DashboardStack.Group screenOptions={{ presentation: 'modal' }}>
</DashboardStack.Group>
</DashboardStack.Navigator>
);
}
const ActivityStack = createNativeStackNavigator<RootStackParamList>();
function RootNavigator() {
return (
<DashboardStack.Navigator>
<DashboardStack.Screen name="Root" component={BottomTabNavigator} options={{ headerShown: false }} />
<DashboardStack.Screen name="NotFound" component={NotFoundScreen} options={{ title: 'Oops!' }} />
<DashboardStack.Group screenOptions={{ presentation: 'modal' }}>
</DashboardStack.Group>
</DashboardStack.Navigator>
);
}

同一个作用域内不能有两个同名的变量。你必须给它们起不同的名字。

相关内容

  • 没有找到相关文章

最新更新