Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html lang="en">
  <head>
<script src="//fb.me/react-with-addons-0.13.1.js"></script>
    <meta charset="UTF-8"/>
    <title>react-docs-playground</title>
  </head>
  <body>
    <div id="mount"></div>
  </body> 
</html>
 
var ControlledForm= React.createClass({
    getInitialState: function() {
        return {
            value: "initial value"
        };
    },
    handleChange: function(event) {
        console.log(this.state.value);
        this.setState({value: event.target.value});
        console.log(this.state.value);
    },
    render: function() {
        return (
            <input type="text" value={this.state.value} onChange={this.handleChange}/>
        );
    }
});
React.render(
    <ControlledForm/>,
  document.getElementById('mount')
);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
tarrsalahpro
0viewers