react-web-gifted-chat
react-web-gifted-chat copied to clipboard
How to configure gift-chat to send message when enter key is pressed?
Issue Description
[FILL THIS OUT]
Steps to Reproduce / Code Snippets
[FILL THIS OUT]
Expected Results
[FILL THIS OUT]
Additional Information
- Nodejs version: [FILL THIS OUT]
- React version: [FILL THIS OUT]
- react-web-gifted-chat version: [FILL THIS OUT]
- Browser(s) (Chrome, etc.): [FILL THIS OUT]
its already available 'onSend'
constructor(props) {
//init stuff
this.onSend = this.onSend.bind(this); //bind the function
}
onSend(message) {
if(message && message[0] && message[0].text){
//send msg to server
}
}
render() {
return (
<GiftedChat
..other props..
onSend={this.onSend}/>
);
}