Function useAuthState

  • Returns and updates the currently authenticated user

    Parameters

    • auth: Auth

      Firebase Auth instance

    Returns UseAuthStateResult

    User, loading state, and error

    • value: User; undefined if user is currently being fetched, or an error occurred
    • loading: true while fetching the user; false if the user was fetched successfully or an error occurred
    • error: undefined if no error occurred