When to Use Stores vs Local State
Choose between component state and stores based on sharing and lifetime needs.
Local State
Use let in a component when the data belongs only to that component.
Component Props
Use export let for inputs from a parent. The parent owns the state.
All lessons in this course
- Reactive Statements: $: block
- Reactive Dependencies and Ordering
- When to Use Stores vs Local State
- Avoiding Stale Closures