{"id":24629661,"url":"https://github.com/princebansal7/learn-react","last_synced_at":"2026-04-12T12:35:28.765Z","repository":{"id":140185016,"uuid":"487085765","full_name":"princebansal7/Learn-React","owner":"princebansal7","description":"Learn React the way I did from scratch.","archived":false,"fork":false,"pushed_at":"2024-07-19T18:09:07.000Z","size":3164,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T06:13:32.748Z","etag":null,"topics":["jsx","reactjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/princebansal7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-04-29T19:17:28.000Z","updated_at":"2024-11-12T09:47:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"a76866d5-f458-4a4c-80f3-0ad99a0b1be6","html_url":"https://github.com/princebansal7/Learn-React","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princebansal7%2FLearn-React","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princebansal7%2FLearn-React/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princebansal7%2FLearn-React/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princebansal7%2FLearn-React/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/princebansal7","download_url":"https://codeload.github.com/princebansal7/Learn-React/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554046,"owners_count":20471172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsx","reactjs"],"created_at":"2025-01-25T06:13:35.744Z","updated_at":"2026-04-12T12:35:28.723Z","avatar_url":"https://github.com/princebansal7.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning React From Basics\n\n#### *Understand the folder structure and working of JSX and React*\n\n##### PS: *`Node.js`* must be installed on your system!!\n- ##### Here is the link for `nvm` commands: \u003ca href=\"https://github.com/princebansal7/Learn-JavaScript#readme\" target=\"_blank\"\u003eclick\u003c/a\u003e\n### 1. To use these folders locally:\n\n\n1. After downloading this Repo go to **Basics** folder, there are ordered sub-folders for learning essential concepts of React.\n2. Now open that particular subfolder *(you want to learn)* in terminal *(preferably VS code)*\n    \n   eg: `% cd /Basics/1.introduction-to-jsx/`\n3. Then use command to install node_modules\n\n    ```shell\n    npm install\n    ```\n\n4. Then\n\n    ```shell\n    npm start\n    ```  \n\n5. It's done ! Play around with the files. I've added brief comments for everything in orderely manner.\n\n6. **node_modules** folder takes a lot of space, so to remove this folder use the below commands, it will locate *node_modules* folder recursively and deletes them. \n  \n   NOTE: Using ``npm install`` we can get **node_modules** anytime we want.\n   \n   - Print out a list of directories to be deleted:\n  \n      ```bash\n      find . -name 'node_modules' -type d -prune\n      ```\n   - Deletes *node_modules* from the current working directory:\n\n      ```bash\n      find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +\n      ```\n\n\n#### **Note:** `package.json`  is one of the most important file. As one of the main purpose is Here you can see all the related dependencies \u0026 modules which **node** is going to install. Also **`npm install`** command uses this `package.json` to download the essential modules and related dependencies to run React project.\n\n\n\u003cbr\u003e\n\n### 2. Key Points:\n\n- To learn about **JavaScript ES6** concepts and methods: \u003ca href=\"https://github.com/princebansal7/Web-Development-Concepts/tree/main/javascript-es6\" target=\"_blank\"\u003eClick here\u003c/a\u003e\n- **Let's Understand the FOLDER STRUCTURE:**\n\n  At beginner level you only need to observe two folders\n  `public`  and `src`\n\n    - **`public`** : folder will be having the main file called ***index.html***\n    and in that file `\u003cdiv class=\"root\"\u003e` is where React will be rendering all of the code using `react` and `react-dom` Modules.\n\n   - **`src`** : folder will be having all the related react components ***(jsx, js files)***.\n      in which mainly we'll be looking at *App.js* file and *index.js* file (starting point of project)\u003cbr\u003e\n   - Further addition of related files and functional components, we will be learning as we go folder-by-folder in order.\n   - Still majorly all the components (functional or class based) they usually resides in `components` folder which we keep inside `src` folder.\n- `ReactDOM.render()` or Any Component in React returns only a single html element.\n- if Multiple html elements or Components are there to be returned, they need to be enclosed in either **jsx fragement** or **single div**\n\n  - JSX fragments\n\n    ```html\n      \u003cReact.Fragment\u003e\u003c/React.Fragment\u003e\n\n      \u003c\u003e\u003c/\u003e\n      ```\n\n  - Single div\n\n    ```html\n    \u003cdiv\u003e\u003c/div\u003e\n    ```\n- React version 18 and above doesn't support ``ReactDOM.render()``, so now it's done using ``createRoot()`` after importing ``import ReactDOM from \"react-dom/client\";``\n  \n  - Old way:\n    ```jsx\n    import React from \"react\";\n    import ReactDOM from \"react-dom\";\n    import App from \"./components/App\";\n\n    ReactDOM.render(\u003cApp /\u003e, document.getElementById(\"root\"));\n    ```\n  - New way:\n      ```jsx\n      import React from \"react\";\n      import ReactDOM from \"react-dom/client\";\n      import App from \"./components/App\";\n\n      const root = ReactDOM.createRoot(document.getElementById(\"root\"));\n      root.render(\u003cApp /\u003e);\n      ```\n- React newer version implementation starts from folder-15 (main changes will be done only in ``index.js``)\n\n\n- **From Folder-16:**\n  \n    We'll be learning about **mapping** and creating basic ***``emojipedia``*** like this (ES6 Concepts must):\n  \u003cimg align=\"right\" alt=\"emoji-pedia\" width=\"800\" src=\"./images/emojipedia-mbp.png\"\u003e\n\n  \u003cimg align=\"right\" alt=\"emoji-pedia\" width=\"800\" src=\"./images/emojipedia-mbp2.png\"\u003e\n  \u0026nbsp \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincebansal7%2Flearn-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprincebansal7%2Flearn-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincebansal7%2Flearn-react/lists"}