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.
updateProfile
{ 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>;} Copy
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>;}
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
updateProfilecallback for mutations.