DEV Community

Cover image for Don't Stress: REACTJS | Components
Orion F.
Orion F.

Posted on

Don't Stress: REACTJS | Components

Hi readers,

Okay I am back with another post. This one will be about the ReactJS components. Let's go right into the notes I've taken for the components. Hope it helps. Enjoy!

*Components
- A part of the web interface.
- Header, SideNav, Main Content, Footer, and one component to contain the prior 4 components. They come together to make the app.
- Components are reusable. ie: The LEFT sideNav can also be the RIGHT sideNav.
- Building blocks of any ReactJS app.

*Component in Code
- a component is usually the code placed in App.js
- You can also have component files with the .jsx extension.

*Component Two Types
- Stateless Functional Component
(- JavaScript Functions)
- Stateful Class Component
(-Class extending Component class)
(-Render method returning HTML)

Top comments (2)

Collapse
 
gkhan205 profile image
Ghazi Khan

You can have a look in to my playlist for creating reusable component in react js. I have functional component with hooks to use state there.

Collapse
 
sergiodxa profile image
Sergio Daniel Xalambrí

JS functions could also be stateful components using hooks.