question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

handleNewUserMessage is doing nothing ?

See original GitHub issue

Hello,

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Draymcommented, Jun 9, 2020

@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 😄

1reaction
cozimacodecommented, Jun 4, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found