JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css">
<app></app>
Babel + JSX
const { Component } = React;
const $app = document.querySelector('app');
class App extends Component {
constructor() {
super();
this.state = {
tasks: [],
inputValue: "",
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
this.setState({inputValue: event.target.value});
}
render() {
return (
<div className="container">
<h1>To Do List</h1>
<input type="text" name="newTask" value={this.state.inputValue} onChange={this.handleChange} />
<div className="container">
<ul className="list-group">
<li>Do Gardening</li>
<li>Return books to library</li>
<li>Go to the Dentist</li>
</ul>
</div>
</div>
);
}
}
ReactDOM.render(
<App/>,
$app
);