Svelte · Middle · Question 7 of 75

When is $state.raw a good choice?

let rows = $state.raw([]);
rows = await fetchRows(); // reassign, don't push

Explanation

Raw state isn't deeply reactive: rows.push(x) won't trigger updates, only reassignment does.

Further reading

Problem with a question

Svelte · Middle · question 7

Test yourself

Take the Svelte · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz