Skip to content

Instantly share code, notes, and snippets.

@DevEarley
Created June 19, 2020 22:11
Show Gist options
  • Select an option

  • Save DevEarley/3b0787d5901e2b7e76221665c69e400a to your computer and use it in GitHub Desktop.

Select an option

Save DevEarley/3b0787d5901e2b7e76221665c69e400a to your computer and use it in GitHub Desktop.
React Starter with JSX
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>React Starter</title>
<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 src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">
const name = 'World!';
const reactStarterJSX = getReactStarterJSX();
ReactDOM.render(
reactStarterJSX,
document.getElementById('root')
);
function getReactStarterJSX() {
return <div>
<h1>Hello, {name}</h1>
<h2>React Starter with JSX</h2>
</div>;
}
</script>
<style>
body {
margin: 0;
background-color: #3d3d3d;
color: #FFF;
font-family: sans-serif;
}
</style>
</head>
<body>
<div id="root"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment