https://github.com/prabhu30/namaste-react
Repository to commit all my projects, codes and assignments done during Namaste React course by Akshay Saini
https://github.com/prabhu30/namaste-react
akshay-saini front-end-development frontend javascript namaste-react react
Last synced: about 1 month ago
JSON representation
Repository to commit all my projects, codes and assignments done during Namaste React course by Akshay Saini
- Host: GitHub
- URL: https://github.com/prabhu30/namaste-react
- Owner: prabhu30
- Created: 2024-03-02T14:49:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-24T07:17:39.000Z (about 2 years ago)
- Last Synced: 2025-02-03T07:32:42.866Z (over 1 year ago)
- Topics: akshay-saini, front-end-development, frontend, javascript, namaste-react, react
- Language: JavaScript
- Homepage:
- Size: 147 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Namaste React 🚀
- Course Link - [Namaste React by Akshay Saini](https://namastedev.com/learn/namaste-react/)
## Setting up a **React** project from Scratch
- Create a folder <- project-name ->
- Open command prompt inside that folder
```
cd project
```
- Create `index.html` file and write this below code in the body
```
```
- To initialize packaging, execute `npm init`
- Install a bundler as dev dependency, for example :-
```
npm install -D parcel
```
- Install react and react-dom dependencies
```
npm i react
npm i react-dom
```
- Write some React and JSX code in your main script, for example in `main.js` write,
```
import ReactDOM from 'react-dom/client';
const root = ReactDOM.createRoot(document.querySelector('.root'));
const Heading = function () {
return (
<h1>Hey, Welcome to Tech Zone! 🚀</h1>
)
}
root.render(<Heading />);
```
- Now, let parcel handler the execution. Run this command - `npx parcel index.html`
- In order to simplify running / spinning up development server, replace this line from `package.json` -
```
"main": "index.js"
```
with this
```
"source": "src/index.html"
```
- In `scripts` object of `package.json`, write this -
```
"start": "parcel",
"build": "parcel build",
```
- From next time, when you want to start the development server, use `npm start`
- If you want to generate a production build, use `npm build`
- That's it, you are good to go!!! Write some amazing react code, and kickstart the server 🚀