Wolox / react-chat-widget

Awesome chat widget for your React App
MIT License
1.47k stars 457 forks source link

New messages are only rendered when the widget is reopened #314

Closed leonardoestrela1999 closed 1 year ago

leonardoestrela1999 commented 1 year ago

I followed the tutorial and after a few tweaks, I managed to get the widget to work more or less as expect. The only problem I'm having right now is that new messages only show up when we reopen the widget.

My project uses React ^18.2.0 (which is probably the source of the problem, considering other issues that are still open)

xXWarMachineRoXx commented 1 year ago

I am experiencing the same issue

sometimes you click on the widget and it does not respond very well

and you have hack and around to get it to work

joaquinsc999 commented 1 year ago

Same Issue here, I have not found a solution yet

leonardoestrela1999 commented 1 year ago

For the record, I gave up on making it work, and ended up choosing another library that worked for my solution. This one seems to be abandoned by the maintainers.

joaquinsc999 commented 1 year ago

The only workaround I found was to downgrade react and react-dom to the 17.0.2 version.

imehrose commented 1 year ago

you don't need to downgrade react to 17, i am using 18.2.0 and its work for me

const [messages, setMessages] = useState([]);

const handleNewUserMessage = (newMessage) => { console.log(New message incoming! ${newMessage}); setMessages([...messages, newMessage]); };

rishabh0049 commented 1 year ago

imehrose

Thanks it worked for me without downgrading, and also in NextJS