#React ES7 ES6 ES5 Syntax
- https://facebook.github.io/react/docs/reusable-components.html
- https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html
- https://babeljs.io/blog/2015/06/07/react-on-es6-plus
- http://www.ian-thomas.net/autobinding-react-and-es6-classes/
- http://blog.ricardofilipe.com/post/babel-react-es7-sample
- standard/standard#372
ES7 require installation of stage-0: npm install --save-dev babel-preset-stage-0
Add transform:
"browserify": {
"transform": [
[
"babelify",
{
"presets": [
"es2015",
"stage-0",
"react"
]
}
]
]
}
import React from 'react'
import ReactDOM from 'react-dom'
import $ from 'jquery'
class $1 extends React.Component {
render() {
var self = this;
return (
<div className="">
</div>
);
}
constructor(props) {
super(props);
}
state = {count: props.initialCount};
componentDidUpdate(prevProps, prevState){
var self = this;
}
handleClick = (e) => {
var self = this;
};
}
module.exports = $1
import React from 'react'
import ReactDOM from 'react-dom'
import $ from 'jquery'
class $1 extends React.Component {
render() {
var self = this;
return (
<div className="">
</div>
);
}
constructor(props) {
super(props);
this.state = {count: props.initialCount};
this.handleClick = this.handleClick.bind(this);
}
componentDidUpdate(prevProps, prevState){
var self = this;
}
handleClick(e) {
var self = this;
}
}
module.exports = $1
var React = require('react');
var $ = require('jquery');
var $1 = React.createClass({
render: function () {
var self = this;
return (
<div className="">
</div>
);
},
getInitialState: function(){
var self = this;
return {
v1: "v1"
};
},
componentDidUpdate: function(prevProps, prevState){
var self = this;
}
});
module.exports = $1;