|
1 |
| -# esbuild React Javascript Template |
| 1 | +# React 18 template ⚛️ |
| 2 | +> Faster as it should be. This template has stripped all tests and dust that is included with CRA (`create-react-app`) template. |
| 3 | +> |
| 4 | +> A very minimal and skimmed setup of React. Hope you liked it. ✌🏽 |
2 | 5 |
|
3 |
| -> This is a Javascript template for [esbuild create react app](https://github.com/awran5/esbuild-create-react-app) project. |
| 6 | +## Default package manager: Yarn (lighter than NPM) |
| 7 | +> You can use NPM too, just remove the `yarn.lock` in that case. |
4 | 8 |
|
5 |
| -## What is inside? |
6 | 9 |
|
7 |
| -- [esbuild](https://esbuild.github.io/) |
8 |
| -- [Eslint](https://eslint.org/) |
9 |
| -- [Prettier](https://prettier.io/) |
10 |
| -- [Husky](https://github.com/typicode/husky) |
11 |
| -- [lint-staged](https://github.com/okonet/lint-staged) |
12 |
| -- [live-server](https://github.com/tapio/live-server) |
| 10 | +       |
13 | 11 |
|
14 |
| -### License |
| 12 | +[](https://github.com/prettier/prettier)   |
| 13 | +[](http://standardjs.com) |
15 | 14 |
|
16 |
| -MIT © [awran5](https://github.com/awran5/) |
| 15 | +## ⚠️This template uses React 18-rc⚠️ |
| 16 | +Since React18 is the future and already in the release candidate, i felt confident of using the rc version of react and react-dom in the template. Not major changes would be made in `rc -> latest release`. |
| 17 | + |
| 18 | +Please read the [docs](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html) for more information about the changes from **React 17 to 18**. |
| 19 | + |
| 20 | +### P.S |
| 21 | +> React 18 uses a new Client Root API, documented below, same has been explained well in `App.js` inside the `src` folder. |
| 22 | +
|
| 23 | + |
| 24 | +```jsx |
| 25 | +// New ROOT API in React 18 ⚛️ |
| 26 | +import { createRoot } from 'react-dom/client'; |
| 27 | +const container = document.getElementById('app'); |
| 28 | +const root = createRoot(container); |
| 29 | +root.render(<App {...props} />); |
| 30 | +``` |
| 31 | + |
| 32 | +## Running the project on port 2000 |
| 33 | +```shell |
| 34 | +npm install |
| 35 | +npm run start |
| 36 | +``` |
| 37 | +> That's it ✌🏽 (Installing the dependencies might take time, depending upon your workstation's computing power and network bandwidth available). |
| 38 | +
|
| 39 | +**After `npm run start` open: [ReactApp🔗](http://127.0.0.1:2000) ** |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +### Advanced Implementations ahead (skip if not needed) |
| 44 | + |
| 45 | +**Please checkout the branch as per your requirement, currently the branches are:** |
| 46 | + |
| 47 | +1. **NextJS with Tailwind** `nextjs-tailwind` -> https://github.com/nooobcoder/clean-react-app/tree/nextjs-tailwind |
| 48 | + |
| 49 | +2. **NextJS with TypeScript** `nextjs-typescript` -> https://github.com/nooobcoder/clean-react-app/tree/nextjs-typescript |
| 50 | + |
| 51 | +3. **React with Typescript (very strict typechecks)** `typescript-react-app` -> https://github.com/nooobcoder/clean-react-app/tree/typescript-react-app |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +A very clean React App ⚛️ starter template by [Ankur Paul](https://github.com/nooobcoder) |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | + |
0 commit comments