Skip to content

Instantly share code, notes, and snippets.

@Jaredk3nt
Created August 2, 2018 02:49
Show Gist options
  • Save Jaredk3nt/aedd54597c73634e445314c723599363 to your computer and use it in GitHub Desktop.
Save Jaredk3nt/aedd54597c73634e445314c723599363 to your computer and use it in GitHub Desktop.
Did you know you can write react without the overhead and boilerplate of tools like CRA? If you are writing a quick application heres a single file html document that lets you get up and running with React fast and even allows you to use es6 and JSX!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Plain Jane React App</title>
</head>
<body>
<div id="root"></div>
<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 crossorigin src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">
class App extends React.Component {
render() {
return (
<h1>Hello World!</h1>
)
}
}
window.onload = function() {
ReactDOM.render(
<App />,
document.getElementById('root')
);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment