The two primary ways of declaring components in React is via functional components and class-based components.
- Functional components are declared with a function that then returns some JSX.
- Class-based components are declared using ES6 classes. They are also known as "stateful" components because their state can hold values throughout the component and can be passed to child components through props.
Another notable feature is the use of a virtual Document Object Model, or virtual DOM. React creates an in-memory data-structure cache, computes the resulting differences, and then updates the browser's displayed DOM efficiently. This allows the programmer to write code as if the entire page is rendered on each change, while the React libraries only render subcomponents that change.
The MERN Stack is a set of four technologies that work together to create dynamic web apps and websites.
It stands for four different technologies, which are listed below:
- M – Mongo DB
- E - Express JS
- R – React JS
- N – Node JS
MERN STACK COMPONENTS
The MERN stack is made up of four parts. Let's take a look at each one individually.
- MongoDB, a NoSQL database management system, is the first component.
- Express JS is the second MERN stack component. It's a Node JS backend web application framework.