Svelte · Middle · Question 59 of 75

How do you give a $bindable prop a fallback value?

let { open = $bindable(false) } = $props();

Explanation

If the parent does bind it, the component writes changes back to the parent's state.

Further reading

Problem with a question

Svelte · Middle · question 59

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