Instantly share code, notes, and snippets.

@Ibro /Chat.jsx
Created Nov 17, 2017

Embed
What would you like to do?
ASP.NET Core SignalR chat with React.js - https://codingblast.com/asp-net-core-signalr-chat-react
render() {
return (
<div>
<br />
<input
type="text"
value={this.state.message}
onChange={e => this.setState({ message: e.target.value })}
/>
<button onClick={this.sendMessage}>Send</button>
<div>
{this.state.messages.map((message, index) => (
<span style={{display: 'block'}} key={index}> {message} </span>
))}
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment