2. Props vs State Demystified
Understanding the difference between Props (external inputs) and State (internal memory) is the foundation of React engineering:
Props vs State Comparison
| Attribute | Props (Properties) | State |
|---|---|---|
| Ownership | Passed in by parent component | Created and owned within the component |
| Mutability | Read-Only (Immutable by the receiving child) | Mutable only via state setter function |
| Purpose | Configure child components and pass callbacks | Hold interactive data that changes over time |
| Re-render Trigger | Changes in parent props trigger child re-render | Calling setter function triggers component re-render |