The use:enhance Directive
Progressively enhance form submissions with client-side fetch, no full reload.
Progressive Enhancement
Forms work without JS; use:enhance upgrades them to fetch-based submissions for snappy UX.
Import enhance
From $app/forms.
import { enhance } from "$app/forms";All lessons in this course
- +page.server.js with actions
- The use:enhance Directive
- Progressive Enhancement for Forms
- Handling Validation Errors in Actions