Difference between Props and Data
Feature | Props | Data |
---|---|---|
Purpose | Passing data from parent to child components | Managing internal state of a component |
Scope | Passed from parent component to child component | Local to the component where it is defined |
Access Control | Cannot be directly modified by the child component | Can be directly modified within the component |
Reactivity | Changes in props by parent trigger re-render in child | Changes in data trigger reactivity within the component |
Communication Pattern | Unidirectional: Parent to Child | Internal to the component |