React Learning

Setting up React and other stages with CLI

reactimage

To check if React is ins...: npm list -g --depth=0
To install React..: npm install -g create-react-app
To delete React..: npm uninstall -g create-react-app

 
To create an app named sema: npx create-react-app sema
To go to vs code: code .
To start coding: npm run start
To install routing: npm i react-router-dom


Library:

To alert: npm install react-toastify


History:

Before react root 18:

React.render(<App />, document.getElementById("root"));



After:

const root = ReactDOM.createRoot(document.getElementById
("root"));
root.render(

<React.StrictMode>

<App />
</React.StrictMode>

);

React:

1. React is a modular library and the reusability of these modules is a significant advantage. They can be broken down into parts like components and used in different projects or on different pages.

2. React can easily manage its dependencies using package managers like npm or Yarn.

3. It is common to integrate third-party libraries and components into React projects. This supports rapid development process.

4. React can use ES modules, but these enable modularity within the project. Disadvantages; In some cases, module confusion, large number of HTTP requests, and browser incompatibility issues may occur. Tools such as Babel can be used to increase browser compatibility.

5. React projects compile projects using Webpack or another packaging tool and package the code into several large files.

6. React improves performance by using Virtual DOM. This is efficient in that it only updates the parts that have changed, minimizing actual DOM manipulations in the browser.

7. React creates user interfaces using JSX (JavaScript XML) syntax. This allows you to add HTML-like structure inside JavaScript code.

8. It supports many languages such as React and TypeScript, and you can use it to ensure type safety.

Comments