Key Topics
React (Part 1)
- Props, state, components (functional vs class), hooks, virtual DOM
React (Part 2)
- API, fetch, modifying request parameters & body in fetch, getting user inputs through form, implementing login form UI
Overview: Development Summary
React (Part 1)
Why React is more useful than plain JS
React offers several benefits over plain Javascript when building web applications:
- Component-based architecture: React encourages the creation of reusable, self-contained components, which leads to cleaner and more maintainable code.
- Virtual DOM: React uses a virtual representation of the DOM, which allows for efficient updates and rendering, improving the overall performance of the application.
- Unidirectional data flow: React enforces a one-way data flow, making it easier to understand and debug complex applications.
Concept of Virtual DOM
The Virtual DOM is a lightweight, in-memory representation of the actual DOM. React uses the Virtual DOM to track changes in the application's state, then updates the real DOM only when necessary. This approach minimizes the number of direct DOM manipulations, leading to better performance and a more responsive user interface.
React Setup
The steps to create a React project are as follows
- Make sure you have Node.js and npm installed on your computer. If you don't have it, you can download and install it from the official website https://nodejs.org/en/download/.
- Open a terminal or command prompt and navigate to the directory where you want to create your project.