Skip to content

Instantly share code, notes, and snippets.

@tylermcginnis
Created April 9, 2018 06:28
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save tylermcginnis/f4481cfdba19b03a1198c61aac9c1b9c to your computer and use it in GitHub Desktop.
Save tylermcginnis/f4481cfdba19b03a1198c61aac9c1b9c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>React</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
</head>
<body>
<div id='app'></div>
<script>
function NameComponent ({ name }) {
return React.createElement(
'h1',
null,
name
)
}
function HandleComponent ({ handle }) {
return React.createElement(
'h3',
null,
handle
)
}
const wrapperElement = React.createElement(
'div',
{ id: 'container' },
React.createElement(NameComponent, { name: 'Tyler' }),
React.createElement(HandleComponent, { handle: '@tylermcginnis'}),
)
console.log('wrapperElement', wrapperElement)
ReactDOM.render(
wrapperElement,
document.getElementById('app')
)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment