Svelte · Senior · Question 65 of 75
Why is mutating data received from load in a page component a bad idea?
- ✓Correct answer: It's owned by SvelteKit and will be replaced on the next navigation or invalidation; derive local state or call an action/invalidate instead
- 2It's read-only and throws in production
- 3It triggers a full page reload
Explanation
Treat data like props: compute with $derived, and use writable deriveds for optimistic UI.