Clone this gist
npm run start
npm init -y
npm install parcel-bundler
Create a index.html with:
<html>
<title>Hello React</title>
<body>
<div id="root"></div>
<script src="index.tsx"></script>
</body>
</html>
Create a index.tsx file with:
import * as React from "react";
import { render } from "react-dom";
const App: React.FC = () => <h1>Hola 👋</h1>;
render(<App />, document.getElementById("root"));
npx parcel index.html
Add this line after the <title>
tag:
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
### eslint with react rules
Install:
$ npm i eslint eslint-plugin-react eslint-plugin-react-hooks @typescript-eslint/parser
Add this to package.json:
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
},