Problem Statement
Differentiate between props and state with examples.
Explanation
Props are read-only inputs passed to a component from its parent. For example, a button can receive a label as a prop.
State is data managed within the component and can change dynamically, like a counter. Changing state triggers a re-render, while props update when parents re-render.
Practice Sets
This question appears in the following practice sets: