Skip to main content

Overview

useUpdateEntity returns a function that updates an entity’s content fields. After a successful update, the entity state inside the nearest EntityProvider is automatically synced with the new data.

Usage Example

Parameters

entityId
string
required
The ID of the entity to update.
update.title
string | null
New title. Pass null to clear.
update.content
string | null
New content body. Pass null to clear.
update.attachments
Record<string, any>[]
Replacement attachments array.
update.keywords
string[]
Replacement keywords array.
update.location
{ latitude: number; longitude: number }
New geographic location.
update.metadata
Record<string, any>
Replacement metadata object.
update.mentions
Mention[]
Updated mentions array.

Returns

Entity
Entity
The updated entity. See Entity data model.