lifecycle of react?
[
]
compare between prop and state ?
[
]
When do we re-render our application?
A re-render can only be triggered if a component’s state has changed. The state can change from a props change, or from a direct setState change. The component gets the updated state and React decides if it should re-render the component.
what is differnce between prop and state?
- In a React component, props are variables passed to it by its parent component. State on the other hand is still variables, but directly initialized and managed by the component. The state can be initialized by props