A JavaScript library for building user interfaces π it is declarative
Components: React is built around the concept of components, which are self-contained UI elements that can be reused throughout your application.
Virtual DOM: React uses a virtual representation of the DOM, which is more efficient than directly manipulating the actual DOM.
State management: React provides a way to manage state with in components, which makes it easier to build complex UIs.
JSX: React uses a syntax extension called JSX, which allows you to write HTML-like code within your JavaScript files.
npm install -g npm@latest
npm init react-app tech-app
cd tech-app
npm start
npx create-react-app tech-app
cd tech-app
npm start
npm create vite@latest
cd tech-app
npm install
npm run dev
const element = React.createElement(
'h1',
{ className: 'greeting' },
'Hello, world!'
);
You can write the same thing using JSX like this:
const element = <h1 className="greeting">Hello, world!</h1>;
In this example, the JSX code is transformed into the same React.createElement call that we wrote before.
JSX allows you to easily compose complex UI components using a familiar syntax. It also allows you to use JavaScript expressions within the markup, which enables dynamic and data-driven rendering of UI components.
While JSX is not required to use React, it has become a widely adopted convention within the React community because of its many benefits
"use strict";
ReactDOM.render( /*#__PURE__*/React.createElement("h1", null, "Welcome to react App"), document.getElementById('root'));
rfc
rafc
https://medium.com/@alimubashar74/react-native-what-is-the-difference-between-functional-and-class-components-25b4920c1686
This project was bootstrapped with Create React App.