For some reason, when "messageAdded" executes, the "messages" state appears as an empty array, making all the previous chat history disappear whenever I type a new message.
Could it be that ChatUI mutates the array? I have no idea why that happens. I spent hours trying to find out, but I couldnt.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is a good point, I intend to update this with hooks at some point too. What's going wrong with hooks for you at the moment?
Here is my component ChatApp written with hooks
pastebin.com/uVekpL41
I'll try to have a play with this today. The ChatUI really shouldn't mutate the array. Will see what I can find.
For some reason, when "messageAdded" executes, the "messages" state appears as an empty array, making all the previous chat history disappear whenever I type a new message.
Could it be that ChatUI mutates the array? I have no idea why that happens. I spent hours trying to find out, but I couldnt.