handleNewUserMessage is doing nothing ?
See original GitHub issueHello,
I have just installed react-chat-widget and set it up correctly.
I can add messages to it using addResponseMessage and everything looks good.
BUT when I enter some text in the chat input and press ‘enter’ or click on the send button, nothing is happening. Nothing in the console as well, no errors or logs from the handleNewUserMessage callback.
I don’t get it as it’s the most basic feature.
import React, {useEffect} from "react";
import {addResponseMessage, Widget} from "react-chat-widget";
import "react-chat-widget/lib/styles.css";
function App() {
useEffect(() => {
addResponseMessage("Hello");
addResponseMessage("What would you like to do ?");
}, []);
const handleNewUserMessage = (newMessage) => {
console.log("New message incoming!", newMessage);
// Now send the message throught the backend API
addResponseMessage("ok");
};
return (
<div className="App">
<Widget
handleNewUserMessage={handleNewUserMessage}>
</div>
);
}
any help would be welcome, thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Mouse movement message being sent to another window is ...
Have your window procedure handle the WM_(NC)HITTEST message to return HTTRANSPARENT for any coordinates that should "pass through". Share.
Read more >How to Write Good Error Messages - UX Planet
Be concise and write a short description that is meaningful for user and gives him a clear idea of the problem and how...
Read more >About Messages and Message Queues - Win32 apps
If the window handle is NULL, DispatchMessage does nothing with the message. An application's main thread starts its message loop after ...
Read more >Window.postMessage() - Web APIs | MDN
The arguments passed to window. postMessage() (i.e., the "message") are exposed to the receiving window through the event object.
Read more >Change Messages notifications & settings - Google Support
Your device sends pictures and videos; Messages handles advanced tasks. Change global settings. Change default notification settings.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mcallegari10 really a big thanks for your fast fix (few minutes), really awesome. Thanks to it, I have added a callback to make it works on the previous version, it was for an urgent prototype. So you saved my day.
I have tried the new version and it’s working just fine as expected now 😄
Tested and works like a charm. Thanks @mcallegari10 😃
Guys, try reinstalling the chat-widget if it doesn’t work for you after updating. It did for me that way.