Closed isekovanic closed 1 week ago
title |
develop |
branch |
diff |
status |
---|---|---|---|---|
js_bundle_size | 442.099609375 KB | 442 KB | 0 B | ๐ข |
:tada: This PR is included in version 5.38.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
๐ฏ Goal
We have an issue with memoization where if you do the following:
doSendMessageRequest
on theChannel
leveldoSendMessageRequest
depend on some local state that gets updated lateronly the initial value of that state would be memoized.
Zendesk ticket: https://getstream.zendesk.com/agent/tickets/55303
๐ Implementation details
The reason why we wrap
sendMessage
in aref
is due to the fact that simply adding it to the dependency array will likely cause a ton of rerenders of components everywhere. I realise it's a hacky way to solve this, but more conventional methods such as wrapping it inside auseCallback
are a bit difficult since we would need to wrap all of its other dependencies in callbacks as well, causing a cascading effect. Ideally, this should be solved by getting rid of theuseMemo
entirely in theMessageInputContext
, but for now this'll have to do.๐จ UI Changes
iOS
Android
๐งช Testing
โ๏ธ Checklist
develop
branch