Skip to content

Commit

Permalink
(FIX) Remove answers from 'src/app.jsx'
Browse files Browse the repository at this point in the history
  • Loading branch information
KiaFathi committed Nov 14, 2014
1 parent 92e8aa7 commit 5a52cb0
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions src/app.jsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,3 @@
'use strict';

var React = require('react');

var boxStyle = {
width: '100px',
height: '100px'
};

var Box = React.createClass({
getInitialState: function(){
return {
value: 'X'
};
},
handleClick: function(){
var oldValue = this.state.value;
var newValue= oldValue === 'X' ? 'O': 'X';
this.setState({
value: newValue
});
},
render: function(){
return (
<button style={boxStyle} onClick={this.handleClick}>{this.state.value}</button>
);
}
});

var Row = React.createClass({
render: function(){
return (
<div>
<Box/>
<Box/>
<Box/>
</div>
)
}
})

React.render(<Row/>, document.body)
var React = require('react');

0 comments on commit 5a52cb0

Please sign in to comment.