File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
package/src/components/Channel Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1758,6 +1758,11 @@ const ChannelWithContext = <
17581758 const sendMessageRef =
17591759 useRef < InputMessageInputContextValue < StreamChatGenerics > [ 'sendMessage' ] > ( sendMessage ) ;
17601760 sendMessageRef . current = sendMessage ;
1761+ const sendMessageStable = useCallback <
1762+ InputMessageInputContextValue < StreamChatGenerics > [ 'sendMessage' ]
1763+ > ( ( ...args ) => {
1764+ return sendMessageRef . current ( ...args ) ;
1765+ } , [ ] ) ;
17611766
17621767 const inputMessageInputContext = useCreateInputMessageInputContext < StreamChatGenerics > ( {
17631768 additionalTextInputProps,
@@ -1811,7 +1816,7 @@ const ChannelWithContext = <
18111816 quotedMessage,
18121817 SendButton,
18131818 sendImageAsync,
1814- sendMessage : ( ... args ) => sendMessageRef . current ( ... args ) ,
1819+ sendMessage : sendMessageStable ,
18151820 SendMessageDisallowedIndicator,
18161821 setInputRef,
18171822 setQuotedMessageState,
You can’t perform that action at this time.
0 commit comments