-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: document signature change to doSendMessageRequest prop
- Loading branch information
1 parent
8b35a8c
commit b8dc1f1
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
docusaurus/docs/React/release-guides/v11/doSendMessageRequest-signature.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
id: minor-breaking-changes-v11 | ||
sidebar_position: 4 | ||
title: Minor breaking changes 11.0.0 | ||
keywords: [migration guide, upgrade, breaking changes, v11] | ||
--- | ||
|
||
### Channel instance as a first argument to doSendMessageRequest | ||
|
||
The `doSendMessageRequest` will from now on be passed the `Channel` instance instead of its CID to avoid forcing the developers to recreate a reference to the `Channel` instance inside the `doSendMessageRequest` function. The developers should adjust their implementation of `doSendMessageRequest` to call directly `await channel.sendMessage(messageData, options)`: | ||
|
||
```ts | ||
import { ChannelProps } from 'stream-chat-react'; | ||
|
||
const doSendMessageRequest: ChannelProps['doSendMessageRequest'] = async (channel, messageData, options) => { | ||
// optional custom logic | ||
await channel.sendMessage(messageData, options); | ||
// optional custom logic | ||
} | ||
``` |