Example:
const [authUser, authLoading, authError] = useAuthState(firebase.auth());
const [user, userLoading, userError] = useDocument(firebase.firestore().doc(`users/${authUser.uid}`));
I can't put useDocument
in a if (authUser)
because React breaks with: Rendered more hooks than during the previous render.