小编Jer*_*avo的帖子

“Stack.Navigator”不能用作 JSX 组件

使用反应导航时存在类型问题,当使用Stack.NavigationStack.Group来自createNativeStackNavigator

该问题表示JSX.element消息末尾的类型不匹配更具体: Type '{}' is not assignable to type 'ReactNode'

整个消息:

'Stack.Navigator' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<Omit<DefaultRouterOptions<string> & { id?: string | undefined; children: ReactNode; screenListeners?: Partial<...> | ... 1 more ... | undefined; screenOptions?: NativeStackNavigationOptions | ... 1 more ... | undefined; defaultScreenOptions?: NativeStackNavigationOptions | ... 1 mo...' is not a valid JSX element.
    Type 'Component<Omit<DefaultRouterOptions<string> & { id?: string | undefined; children: …
Run Code Online (Sandbox Code Playgroud)

typescript react-native react-navigation expo react-navigation-v6

42
推荐指数
3
解决办法
2万
查看次数

类型“{}”上不存在属性“children”

我遇到打字稿错误。它说类型“{}”上不存在“children”,尽管此语法适用于我的其他项目。

typescript reactjs

11
推荐指数
3
解决办法
2万
查看次数