Skip to content

Instantly share code, notes, and snippets.

@mcallegari10
Last active September 7, 2017 21:27
Show Gist options
  • Save mcallegari10/bf7085fd5e87a42269aa8db555c5e48c to your computer and use it in GitHub Desktop.
Save mcallegari10/bf7085fd5e87a42269aa8db555c5e48c to your computer and use it in GitHub Desktop.
React Chat Widget 2
import React, { Component } from 'react';
import { Widget } from 'react-chat-widget';
class App extends Component {
handleNewUserMessage = (newMessage) => {
console.log(`New message incomig! ${newMessage}`);
// Now send the message throught the backend API
}
render() {
return (
<div className="App">
<Widget
handleNewUserMessage={this.handleNewUserMessage}
/>
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment