Skip to content

Commit 30c7770

Browse files
bertybotbertybot2ghostdevv
authored
docs: fix type for form action example (#10693)
Co-authored-by: RBengtson <[email protected]> Co-authored-by: Willow (GHOST) <[email protected]>
1 parent cac42de commit 30c7770

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

documentation/docs/20-core-concepts/30-form-actions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,11 @@ We can also implement progressive enhancement ourselves, without `use:enhance`,
412412
/** @type {any} */
413413
let error;
414414
415+
/** @param {{ currentTarget: EventTarget & HTMLFormElement}} event */
415416
async function handleSubmit(event) {
416-
const data = new FormData(this);
417+
const data = new FormData(event.currentTarget);
417418
418-
const response = await fetch(this.action, {
419+
const response = await fetch(event.currentTarget.action, {
419420
method: 'POST',
420421
body: data
421422
});

0 commit comments

Comments
 (0)