Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and

I’ve been stuck on this problem for days.
upon completing the authentication and authorization section, I get this error

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.

According to my research it might be caused by some import or expo error but I have double checked everything and it seems fine. Anybody with a solution kindly help. Thanks!

here is my app.js code

import React, { useState } from “react”;
import { NavigationContainer } from “@react-navigation/native”;
import { AppLoading } from “expo”;

import navigationTheme from “./app/navigation/navigationTheme”;
import AppNavigator from “./app/navigation/AppNavigator”;
import OfflineNotice from “./app/components/OfflineNotice”;
import AuthNavigator from “./app/navigation/AuthNavigator”;
import AuthContext from “./app/auth/context”;
import authStorage from “./app/auth/storage”;

const App = () => {
const [user, setUser] = useState();
const [isReady, setIsReady] = useState(false);

const restoreUser = async () => {
const user = await authStorage.getUser();
if (user) setUser(user);
};

if (!isReady)
return (
<AppLoading startAsync={restoreUser} onFinish={() => setIsReady(true)} />
);

return (
<AuthContext.Provider value={{ user, setUser }}>


{user ? : }

</AuthContext.Provider>
);
};

export default App;

My guess is that AppLoading or AuthContext.Provider is undefined. Could you add some logging to see if that’s the case? For example below your import statements you could add:

console.log("AppLoading:", AppLoading);
console.log("AuthContext.Provider:", AuthContext.Provider);