-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Describe the problem
I want to add extra data to the enhanced form before submit (captcha token in my case), I can't because can't be an async function.
<script>
import x (async function)
<script>
<form
action="?/login"
method="POST"
use:enhance={async ({ data }) => {
await x;
return async ({ result }) => {
await invalidateAll();
await applyAction(result);
};
}}
>
<input..../>
<input..../>
<button type="submit">Submit>/button>
</form>Based on: #7581
Describe the proposed solution
Make enhanced function async use:enhance={async ({ data }) => { or add as a note in form documentation.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels