Код: Выделить всё
/app/context/AuthContext.tsx
/app/screens/Home.tsx
/app/screens/Login.tsx
/app/_layout.tsx
/package.json
При запуске приложения я получаю следующие две ошибки< /p>
Код: Выделить всё
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Check your code at _layout.tsx:23
Код: Выделить всё
Error: A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found 'undefined' for the screen 'Login Screen'). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.
Код: Выделить всё
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { AuthProvider, useAuth } from './context/AuthContext';
import Home from './screens/Home';
import Login from './screens/Login';
const Stack = createNativeStackNavigator();
export default function RootLayout() {
return (
);
}
export const Layout = () => {
const { authState, onLogout } = useAuth();
return(
{authState?.authenticated ? (
) : (
)}
);
};
Код: Выделить всё
import { Text, View } from "react-native";
import React from 'react';
const Home = () => {
return (
Home
);
};
export default Home;
Почему я это делаю? мне не хватает того, что я не могу экспортировать?
Подробнее здесь: https://stackoverflow.com/questions/790 ... -undefined
Мобильная версия