Created
August 20, 2017 08:51
-
-
Save chrislewisdev/731c8036ce33241d6870016b0280cfb6 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
<html> | |
<head> | |
<title>React Hello World</title> | |
<script src="https://unpkg.com/react@15/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script> | |
window.onload = function() | |
{ | |
class Greetings extends React.Component | |
{ | |
render() | |
{ | |
return React.createElement('h1', null, 'Greetings, ' + this.props.name + '!'); | |
} | |
} | |
ReactDOM.render( | |
React.createElement(Greetings, { name : 'Chris' }), | |
document.getElementById('root') | |
); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment