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)
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.
Learn how to create reusable components in reactjs.
Ghazi Khan ・ Dec 18 ・ 1 min read
JS functions could also be stateful components using hooks.