Skip to content

Instantly share code, notes, and snippets.

@chrislewisdev
Created August 20, 2017 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislewisdev/731c8036ce33241d6870016b0280cfb6 to your computer and use it in GitHub Desktop.
Save chrislewisdev/731c8036ce33241d6870016b0280cfb6 to your computer and use it in GitHub Desktop.
<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