Hiyve Components - v1.0.0
    Preparing search index...
    • Access the authenticated user's profile with loading/error state and an update function.

      Fetches the profile automatically when the user is authenticated and provides a stable updateProfile callback for mutations.

      Returns {
          error: Error | null;
          isLoading: boolean;
          profile: UserProfile | null;
          updateProfile: (params: UpdateProfileParams) => Promise<UserProfile>;
      }

      { profile, isLoading, error, updateProfile }

      function ProfilePage() {
      const { profile, isLoading, error, updateProfile } = useProfile();
      if (isLoading) return <Spinner />;
      if (error) return <p>Error: {error.message}</p>;
      return <p>Hello, {profile?.name}</p>;
      }