Skip to content

Commit

Permalink
Convert example to ES6 class
Browse files Browse the repository at this point in the history
  • Loading branch information
btmills committed Jun 28, 2016
1 parent 9e14ac7 commit b40cbbb
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions examples/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@ import ReactDOM from 'react-dom';

import Datamap from '../src';

const App = React.createClass({ // eslint-disable-line react/prefer-es6-class
class App extends React.Component {

displayName: 'App',
state = {
height: 300,
scope: 'world',
width: 500
};

getInitialState() {
return {
height: 300,
scope: 'world',
width: 500
};
},

handleUpdate() {
handleUpdate = () => {
this.setState(Object.assign({}, {
height: parseInt(this.refs.height.value, 10) || null,
scope: this.refs.scope.value || null,
width: parseInt(this.refs.width.value, 10) || null
}, window.example));
},
};

render() {
return (
Expand All @@ -39,7 +35,7 @@ const App = React.createClass({ // eslint-disable-line react/prefer-es6-class
);
}

});
}

ReactDOM.render(
<App />,
Expand Down

0 comments on commit b40cbbb

Please sign in to comment.