Skip to content

Instantly share code, notes, and snippets.

@arvinio
Last active April 8, 2017 13:23
Show Gist options
  • Save arvinio/9c63e0ad23fbe0ce1780ff31440667a1 to your computer and use it in GitHub Desktop.
Save arvinio/9c63e0ad23fbe0ce1780ff31440667a1 to your computer and use it in GitHub Desktop.
React with ES6
/*
Before: Without ES6
*/
var App = React.createClass({
getInitialState : function() {
return {
fishes : {},
order : {}
},
//...
})
/*
After: With ES6
*/
class App extends React.component{
constructor() {
super()
this.state = {
fishes : {},
order : {}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment