DEV Community

Discussion on: Build a chat app with Twilio and KendoReact

Collapse
 
philnash profile image
Phil Nash

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?

Collapse
 
enriquemorenotent profile image
Enrique Moreno Tent • Edited

Here is my component ChatApp written with hooks

pastebin.com/uVekpL41

Thread Thread
 
philnash profile image
Phil Nash

I'll try to have a play with this today. The ChatUI really shouldn't mutate the array. Will see what I can find.

Collapse
 
enriquemorenotent profile image
Enrique Moreno Tent

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.