Skip to content

Instantly share code, notes, and snippets.

@noateden
Last active August 5, 2018 08:56
Show Gist options
  • Save noateden/693d1c9e2234f290056262828fa80340 to your computer and use it in GitHub Desktop.
Save noateden/693d1c9e2234f290056262828fa80340 to your computer and use it in GitHub Desktop.
Hello ReactJS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Getting started with ReactJS</title>
</head>
<body>
<div id="hello"></div>
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
<script type="text/javascript">
/** @jsx React.DOM */
'use strict'
const e = React.createElement;
const helloEle = document.querySelector('#hello');
class HelloEle extends React.Component{
// constructor(props){
// super(props);
// };
render(){
return e(
'h1',
{},
'Hello World'
);
}
}
ReactDOM.render(e(HelloEle), helloEle);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment