Created
April 16, 2016 16:42
-
-
Save nguyenvanduocit/a39bb3fed0891328fd174b900934f066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Trong ES5 | |
var Greeting = React.createClass({ | |
render: function() { | |
return React.createElement("p", null, "Hello, Universe"); | |
}, | |
}); | |
ReactDOM.render( | |
React.createElement(Greeting), | |
document.getElementById('greeting-div') | |
); | |
//Hoặc trong ES6 | |
class Greeting extends React.Component { | |
render() { | |
return React.createElement("p", null, "Hello, Universe"); | |
} | |
} | |
ReactDOM.render( | |
React.createElement(Greeting), | |
document.getElementById('greeting-div') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment