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.