class TweetBox extends React.Component {
constructor(props) {
super(props);
this.state = {
text: '',
};
}
handleChange = (e) => {
this.setState({ text: e.target.value });
};
render() {
return (
<div className="card bg-light">
<div className="card-body text-right">
<textarea className="form-control" onChange={this.handleChange}></textarea>
<br/>
<button className="btn btn-primary" disabled={this.state.text.length === 0}>Tweet</button>
</div>
</div>
);
}
};
ReactDOM.render(
<TweetBox />,
document.getElementById("container")
);
View Compiled