Skip to content

Instantly share code, notes, and snippets.

@mekicha
Last active December 19, 2017 13:59
Show Gist options
  • Save mekicha/d738ce7dd8692aa57b1ce9acc75d5561 to your computer and use it in GitHub Desktop.
Save mekicha/d738ce7dd8692aa57b1ce9acc75d5561 to your computer and use it in GitHub Desktop.
The Beginner's Guide to ReactJS by Kent C. Dodds
<div id="root"></div>
<script src="unpkg.com/react@16.0.0/umd/react.production.min.js"></script>
<script src="unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js
"></script>
<script type="text/javascript">
// const rootElement = document.getElementById('root');
// const element = document.createElement('div');
// element.textContent = 'Hello World';
// element.className = 'container';
// rootElement.appendChild(element);
const rootElement = document.getElementById('root');
const element = React.createElement(
'div',
{className: 'container'},
'Hello World'
)
ReactDOM.render(element, rootElement)
</script>
<div id="root"></div>
<script src="unpkg.com/react@16.0.0/umd/react.production.min.js"></script>
<script src="unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js
"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">
const rootElement = document.getElementById('root');
const content = "hello world"
const className = 'container'
const props = { content, className }
const element = <div{ ..props } />
ReactDOM.render(element, rootElement)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment