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.
Cool article, well written and complete, even though for some reason I have not managed to build it using react hooks.
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?
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.
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.