JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/[email protected]/prop-types.js"></script>
<script src="http://react.zpao.com/builds/master/latest/react.development.js"></script>
<script src="http://react.zpao.com/builds/master/latest/react-dom.development.js"></script>
<div id="container"></div>
Babel + JSX
class App extends React.Component {
static propTypes = {
name: PropTypes.string,
};
state = { value: 'some text with spaces' }
handleChange = ({ target: { value }}) => {
console.log(value);
this.setState({ value })
}
render() {
return (
<div>
<input type="email" value={this.state.value} onChange={this.handleChange} />
</div>
);
}
}
ReactDOM.render(<App name="world"/>, document.getElementById('container'));