React Functional Components

up:: React Components

Components and the DOM

After the initial render, components only ever get re-rendered on state change in the component or in a parent.

React then evaluates components and passes them to the ReactDOM. Only changes to the virtual DOM get rendered.

Barebones component setup

import React from "react"; // This is not needed but clarifies tthat JSX is used under the hood
 
// import './NewComponent.css';
 
const NewComponent = () => {
  return <div>Hello World!</div>;
};
 
export default NewComponent;