Component:-
----------
- A component is a function/class which will display something to the user. It is the building block of the react.
- We can write components once and reuse the entire project.
- It helps to avoid duplicate code.
- A component may have CSS and js files.
- Component name must be written using camel case and starts with the capital as shown below.
- Components come in two types, Class components, and Function components.
1. function based components
2. class-based components
Note:-
In older React code bases, you may find Class components primarily used. function components are introduced from React 16.8 2019
- When the state object changes, the component re-renders.
- Refer to the state object anywhere in the component by using this. state.property name syntax:
Download
0 formats
No download links available.
Part 4 React components | React class components | Functional React components | NatokHD