Create a react app using parcel

kartik goyal
Jul 29, 2023

--

System ubuntu
1. install node and npm
2. npm init — create package json file
3. inside package json file
- remove main key (its values can only be js, cjs, mjs)
- add source key value as index.html (as source key value can have a file with extension html)
4. Using parcel
- install parcel as dev dependency
Install
- install react and react-dom as dependency
5. index.html
- Write basic html code
- include app js using script tag
- create a div with id as root
6. app js
- Create a functional component/function return some jsx
- Now use react-dom create element to override the div having root id
— using getelement by id

React app will work

--

--

No responses yet