Skip to content

Commit 9ee3d19

Browse files
boring91claude
authored andcommitted
docs: scope the hook-style body example to hooks in the changeset
On ChatClient the second positional argument is the raw body, so the { body } options form belongs to the hooks; direct ChatClient callers pass it as the third argument. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ca844df commit 9ee3d19

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.changeset/spotty-donuts-repeat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Add `body` to `SendMessageOptions`: a per-call body shallow-merged into the requ
66

77
`ChatClient.sendMessage` already accepted a per-call body as its positional second argument, but the framework hooks (`useChat`, `injectChat`, `createChat`, …) expose `sendMessage(content, options)` and forwarded `undefined` for it — leaving no race-free way to send per-message data (e.g. attachment ids) through a hook. Updating a reactive chat-level `body`/`forwardedProps` option right before sending is racy because reactive option changes can flush after the send.
88

9-
`sendMessage(content, { body: { ... } })` now works through every framework hook and on `ChatClient` directly. The positional argument wins if both are provided. Queued sends preserve their per-call `body` exactly like the positional form.
9+
`sendMessage(content, { body: { ... } })` now works through every framework hook. On `ChatClient` directly, pass it as the third argument — `sendMessage(content, undefined, { body: { ... } })` — or keep using the positional second argument, which wins if both are provided. Queued sends preserve their per-call `body` exactly like the positional form.

0 commit comments

Comments
 (0)