What are React Components?
Components can take data and render that data as HTML in the DOM. So a Component can tell you what to render to a page. They are like building boxes or cubes of a React App. There different types of components but we will go over the two main components known as Functional Components and Class Components.
Here below is an example of a Class Component.
A Functional Component and a Class Component are similar, but with Class Components, you can have more features that make it more complex. Class Components can actually work together and interact with each other. You can also pass in data to and from another Class Component.
Another React Component that you will run into is the Container Component.
The Container Components are basically a Class Component, but it fetches data and can render the corresponding sub-component. These components are concerned with how things work and they call flux actions and provide callbacks to presentational components. Presentational components are concerned with how things look and can contain presentational and container components, they receive data and callbacks via props.
Here below is an example of a Container Component.