Best practice for removing type errors for references like auth, user etc. #1539
-
I know some workarounds but really curious how everyone else deals with this in a clean way. |
Beta Was this translation helpful? Give feedback.
Answered by
ralacerda
Jun 10, 2024
Replies: 1 comment
-
This happens because the Auth module is not avaliable on the server, so it can be null. const auth = useFirebaseAuth()! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 (!
)The documentation includes an tip about this