<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CodePen</title>
</head>
<body>
<div id="container"></div>
</body>
</html>
class TweetBox extends React.Component {
handleChange = (e) => {
console.log(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">Tweet</button>
</div>
</div>
);
}
};
ReactDOM.render(
<TweetBox />,
document.getElementById("container")
);
View Compiled