Hiyve Components - v1.0.0
    Preparing search index...
    • Access user data and authentication status.

      A convenience hook that returns only user-related state and the refreshUser action, avoiding unnecessary re-renders from unrelated context changes.

      Returns {
          isAuthenticated: boolean;
          isLoading: boolean;
          refreshUser: () => Promise<void>;
          status: AuthStatus;
          user: AuthUser | null;
      }

      { user, isAuthenticated, isLoading, status, refreshUser }

      function Greeting() {
      const { user, isAuthenticated } = useUser();
      if (!isAuthenticated) return null;
      return <p>Welcome, {user?.name || user?.email}</p>;
      }