在本机反应中更改屏幕时出现问题

问题描述 投票:0回答:0

我创建了一个原生的应用程序与打字稿反应,安装了依赖项,并安装了很多东西试图解决我的问题

似乎在某个模块的子数组中有一个未定义的。

import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import HomeScreen from './components/screens/HomeScreen';
const Stack = createNativeStackNavigator();

const Home = (props:any) =>
{
  return(
    <p>Hola</p>
  )
}
const App = () => {
  return (
    <NavigationContainer>
      <Stack.Navigator initialRouteName='Home'>
        <Stack.Screen name="Home"
          component={HomeScreen}
          options={{ title: 'Main Screen' }}
        />
        <Stack.Screen name="Hola"
          component={Home}
          options={{ title: 'asd Screen' }}
        />
      </Stack.Navigator>
    </NavigationContainer>
  );
};

export default App;

enter image description here

reactjs typescript native
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.