Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: undefined is not an object (evaluating 'auth.user') #2

Closed
Tshibek opened this issue Jan 14, 2021 · 6 comments
Closed

TypeError: undefined is not an object (evaluating 'auth.user') #2

Tshibek opened this issue Jan 14, 2021 · 6 comments

Comments

@Tshibek
Copy link

Tshibek commented Jan 14, 2021

Error in AppNavigator.js with useContext:
Undefined is not an object(evaluating "auth.user")

@codingki
Copy link
Owner

codingki commented Jan 20, 2021

which template did u use @Tshibek ?
did you already fill your firebase config?
https://github.com/codingki/react-native-expo-template/tree/master/template-typescript-bottom-tabs-with-auth-flow#usage

@Tshibek
Copy link
Author

Tshibek commented Jan 21, 2021

I used template-javascript-bottom-tabs-with-auth-flow and i added my config like in readme was so you tell me to use typescript then javascript

@codingki
Copy link
Owner

if you using the typescript one, its inside the ./navigation/index.tsx file. but if you using the javascript one its inside ./navigation/AppNavigator.js

@Tshibek
Copy link
Author

Tshibek commented Jan 23, 2021

But I did it everything good, because if i do something like that in ./navigation/AppNavigator.js

export default () => { const user = AuthContext.user; return ( <NavigationContainer> {user == null && <Loading />} {user == false && <Auth />} {user == true && <Main />} </NavigationContainer> ); };
its without erro what i said up, added to database my user, but its loading all the time because it not see user type

@codingki
Copy link
Owner

const auth = useContext(AuthContext); const user = auth.user;
try do it like this

@Tshibek
Copy link
Author

Tshibek commented Jan 24, 2021

If I used it i have error like above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants