What is the difference between state and props in React?
Question :
What is the difference between state and props in React?
State is internal to a component and managed by the component itself. It represents mutable data that can change over time.
Props (short for properties) are passed to a component from its parent component. They are read-only and cannot be modified by the component receiving them.
How can you prevent a component from rendering in React?
To prevent a component from rendering in React, you can use the shouldComponentUpdate() lifecycle method. By implementing this method and returning false in certain conditions, you can control whether the component should update or not.