Svelte · Senior · Question 40 of 75

How does use:enhance customization work?

<form method="POST" use:enhance={({ formData, cancel }) => {
  submitting = true;
  return async ({ result, update }) => {
    submitting = false;
    await update();
  };
}}>

Explanation

Skipping update() lets you handle results fully yourself, for example to avoid resetting the form.

Further reading

Problem with a question

Svelte · Senior · question 40

Test yourself

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

Take this quiz