Skip to content
Discussion options

You must be logged in to vote

The docs say:

Returns the function that may be used to submit a form (or some raw FormData) to the server using the same process that Form uses internally onSubmit.

Doesn't that mean that you could create your own FormData which can be passed? That means you can pass whatever you like to submit. For example:

const fd1 = new FormData()
fd1.append('hello', 'there')

const fd2 = new FormData(someFormEl)

const combinedObj = {
   ...Object.fromEntries(fd1.entries()),
   ...Object.fromEntries(fd1.entries())
}

// The below might not be needed as submit() also takes a { [name: string]: string }
// https://github.com/remix-run/remix/blob/5783dc00fa27c6198c332096d70ae638f2767e4a/packages/remix-…

Replies: 1 comment 1 reply

Comment options

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

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