Skip to content

Instantly share code, notes, and snippets.

@valex
Created October 20, 2018 13:07
Show Gist options
  • Save valex/ba689785c4c64866a99e026c1db10422 to your computer and use it in GitHub Desktop.
Save valex/ba689785c4c64866a99e026c1db10422 to your computer and use it in GitHub Desktop.
React Hello World
<!DOCTYPE html>
<html>
<head>
<title>hello React</title>
<meta charset="utf-8">
</head>
<body>
<div id="app">
<!-- my app renders here -->
</div>
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<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>
<script type="text/babel">
const headStyle = {
color: 'blue',
background: 'black',
fontFamily: 'Verdana',
};
const element = <h1 style={headStyle} className="pretty" id="my-heading"><span><em>Hell</em>o, world</span></h1>;
ReactDOM.render(element, document.getElementById('app'));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment