Skip to content

Instantly share code, notes, and snippets.

@aceakash
Last active November 21, 2018 13:31
Show Gist options
  • Save aceakash/1270a182c3e57da80c3bcb9951603c23 to your computer and use it in GitHub Desktop.
Save aceakash/1270a182c3e57da80c3bcb9951603c23 to your computer and use it in GitHub Desktop.
React quick start
npm i live-server -g
live-server
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<!-- We will put our React component inside this div. -->
<div id="root"></div>
<!-- Load React. -->
<!-- Note: when deploying, replace "development.js" with "production.min.js". -->
<script src="https://unpkg.com/react@16.7.0-alpha.2/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16.7.0-alpha.2/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<!-- Load our React component. -->
<script type="text/babel" src="main.js"></script>
</body>
</html>
'use strict';
function App(props) {
return (
<h1>Hello world</h1>
)
}
const domContainer = document.querySelector('#root');
ReactDOM.render(<App />, domContainer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment