The user ID, resource type, project ID, or organization ID
The user data and loading state
const { data, isPending } = useUser({
userId: 'gabc123',
resourceType: 'project',
projectId: 'my-project-id',
})
return (
<div>
{isPending && <p>Loading...</p>}
{data && (
<figure>
<img src={data.profile.imageUrl} alt='' />
<figcaption>{data.profile.displayName}</figcaption>
<address>{data.profile.email}</address>
</figure>
)}
</div>
)
Retrieves a single user by ID for a given resource (either a project or an organization).