JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="app">
</div>
<script src="https://fb.me/react-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
</body>
</html>
CSS
body {
font-family:arial;
}
Babel + JSX
const Nav = ({ handleClick }) => {
return (<button onClick={handleClick}>hello world</button>);
}
class HelloMessage extends React.Component {
constructor(props){
super(props);
this.state = {
checked: false
}
}
handleClick = (e) => {
e.preventDefault();
this.setState({checked: !this.state.checked});
}
render() {
return (
<div>
<Nav handleClick={this.handleClick}/>
<p><b>status:</b> {this.state.checked ? 'checked' : 'unchecked'}</p>
</div>
);
}
}
ReactDOM.render(
<HelloMessage name="Taylor" />,
document.getElementById('app')
);