Skip to content

Best practice for removing type errors for references like auth, user etc. #1539

Closed Answered by ralacerda
sugoidesune asked this question in Questions and Help
Discussion options

You must be logged in to vote

This happens because the Auth module is not avaliable on the server, so it can be null.
When you call useFirebaseAuth you can include the Non-null assertion operator (!)

const auth = useFirebaseAuth()!

The documentation includes an tip about this

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants