Overview
useEntity reads from the nearest EntityProvider in the component tree and returns the entity’s state and actions. It does not fetch data itself — it accesses what EntityProvider has already loaded.
useEntity must be used inside an EntityProvider. See EntityProvider & useEntity for setup instructions.Usage Example
Return Values
Entity | null | undefined
The current entity.
undefined while loading, null if not found.React.Dispatch
Direct state setter for the entity. Use for manual local state overrides.
(props: { update }) => Promise<Entity | undefined>
Updates the entity on the server and syncs local state. Accepts
title, content, attachments, keywords, location, metadata, and mentions.() => Promise<void>
Deletes the entity and sets local state to
undefined.
