You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example, User2's messages are getting erased from the state as soon as the User1 sends a message.
I'm persuaded it's a React setState mistake but I've followed the react-native-chat-ui's docs as much as possible but somehow there is something going wrong and I cannot put my finger on it.
To test, just type a message and wait 1 second for the User2 to reply and you'll see that as soon as the User2 replies, the User1's messages disappear.
What's weird is that the User2's messages persist which boggles my mind and makes me think it might be related to the project and not only a React setState mistake. (I thought maybe I don't wait for setState to be done executing but this doesn't seem to be the case)
I've been scratching my head for a hour on this so I thought I'd ask here.
tbergeron
changed the title
User1 messages disappear once User2 replies; setState going wrong?
User2 messages disappear once User1 replies; setState going wrong?
Dec 28, 2022
In the following example,
User2
's messages are getting erased from the state as soon as theUser1
sends a message.I'm persuaded it's a React
setState
mistake but I've followed thereact-native-chat-ui
's docs as much as possible but somehow there is something going wrong and I cannot put my finger on it.To test, just type a message and wait 1 second for the
User2
to reply and you'll see that as soon as theUser2
replies, theUser1
's messages disappear.What's weird is that the
User2
's messages persist which boggles my mind and makes me think it might be related to the project and not only a ReactsetState
mistake. (I thought maybe I don't wait forsetState
to be done executing but this doesn't seem to be the case)I've been scratching my head for a hour on this so I thought I'd ask here.
Here is a video of the bug in action: https://streamable.com/rxbx18
Anybody has an idea?
Amazing project by the way!
Thanks!
The text was updated successfully, but these errors were encountered: