State and Props
7 pages · ~5 min✓ Reviewed
Builds on Components and JSX. Next up: Hooks.
Props, State and One-Way Flow
1. Props vs State
| Props | State | |
|---|---|---|
| Owner | Parent | The component |
| Mutable? | Read-only | Via setter only |
| Change means | New input | Re-render |
2. One-Way Flow
- Parent stateuseState
- Props downread-only
- Childrenders
- Callback uponAdd()