最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论