Skip to content
Discussion options

You must be logged in to vote

Hey binajmen,

You'll just need to call applyAction(result) to have those same behaviours.

<script>
+  import { enhance, applyAction } from '$app/forms';

  let isSubmitting = false;
</script>

<form
  method="POST"
  use:enhance={() => {
    isSubmitting = true;
+   return async ({ result }) => {
+     await applyAction(result);
      isSubmitting = false;
    };
  }}
>

https://kit.svelte.dev/docs/form-actions#progressive-enhancement-applyaction

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@binajmen
Comment options

Answer selected by binajmen
Comment options

You must be logged in to vote
2 replies
@binajmen
Comment options

@binajmen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants