javascript - Since upgrading to Expo 52, I can't create any Stack Layout or Tabs. I always end up with this error - Stac

Warning: Error: A navigator can only contain 'Screen', 'Group' or 'React.Fragme

Warning: Error: A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found 'Screen' for the screen 'index'). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.

This is my layout Organisation

import { View, Text } from "@components/Themed";
import { Stack } from "expo-router";
import React from "react";

const Layout = () => {
    return (
        <View className="flex-1">
            <Stack
                screenOptions={{
                    headerShown: false,
                }}
            >
                <Stack.Screen name="index" />
            </Stack>
        </View>
    );
};
export default Layout;

And the _layout.tsx and index.tsx are in the same directory.

I'm using "@react-navigation/native": "^7.0.3", and "expo-router": "~4.0.6". This is using File-based Navigation Router.

I have tried updating @react-navigation/native, ran --expo prebuild.

I have tried a bunch of anisation tactics but none has worked. The moment I use a Stack or Tabs, the app crashes.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742421129a4440703.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信