Skip to content

Instantly share code, notes, and snippets.

@vnys
Last active November 22, 2018 08:30
Show Gist options
  • Save vnys/7f425a8417c54db9a15482d7b1558eb7 to your computer and use it in GitHub Desktop.
Save vnys/7f425a8417c54db9a15482d7b1558eb7 to your computer and use it in GitHub Desktop.
React and Parcel simplest setup possible
{
"presets": [
"@babel/preset-react"
]
}
  1. Create index.html
  2. Create index.js
  3. npm i -D parcel
  4. Create .babelrc
  5. Add parcel index.html to scripts
  6. npm start
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script src="index.js"></script>
</body>
</html>
import React from "react"
import ReactDOM from "react-dom"
const App = () => <div>You’re the only one, Joe!</div>
const mountNode = document.getElementById("app")
ReactDOM.render(<App />, mountNode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment