Understanding Components

Clayon Stewart
1 min readApr 20, 2022

--

There were 2 types of components I worked with while doing this project. One being an extension of the Component class and the other being a stateless functional Component.

A functional component

The biggest difference in this is how I applied their uses. For functional components, I simply used them to display quick html like a display page. For component classes, I used those on my forms or containers. where i needed to pull information from an async request and store that information in the state of the component as in the photo bellow:

a Class Component

My login container, above, used the state to keep track of my input changes in the form. I also decided to use this so that I can add my dispatch functions to the class’ props field. I usually try to use functional components where I can and limit class component to where i need to access my stores using the redux framework.

--

--

Clayon Stewart
0 Followers

I am a software engineer, with a background in computer hardware and networking, and is always looking to improve my skills and knowledge.