-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛] Channel switching breaks if reusing an existing view #2670
Comments
Hi @oddanderson , Since For example, you can do something like:
or whatever and this should indeed rerender correctly. |
Hey, @oddanderson, did the above solution help fix your issues? If yes, please feel free to close the issue else we can debug further. Thanks 😄 |
Hey, @oddanderson, is there any update on the issue? Did the above suggestion fix it for you? If yes, we will close it, or we can debug it together. |
Hi, I had this same issue and and adding a key to did not trigger a re-render of the messages. However, adding a key to the did. Hope this helps. |
You mean the key to the |
Issue
If you have a view with the following structure:
If this View is persisted when changing channels, and the channelObj changes to a new channel, the MessageList does not automatically update in most circumstances.
The exception to this is if you start using MessageInput to send messages. Once you "send a message," switching channels works as expected. However, if you load up a channel on a fresh boot without ever sending a message, the UI will not appropriately update until you send a message.
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to be able to see the messages in a newly selected channel in a View without destroying it and without needing to send a message.
Project Related Information
Customization
Click To Expand
Offline support
Environment
Click To Expand
package.json
:# N/A
react-native info
output:stream-chat-react-native
version you're using that has this issue:e.g. Android 10
e.g. iPhone 11
Additional context
Screenshots
Click To Expand
The text was updated successfully, but these errors were encountered: