react icon indicating copy to clipboard operation
react copied to clipboard

Use `FormData` `submitter` parameter

Open jenseng opened this issue 1 month ago • 4 comments

Summary

Fixes #29018

Rather than continuing to maintain/fix a partial polyfill (e.g. #28056), just pass the submitter to the FormData constructor, since it is now widely available. This ensures that the form data is populated consistently with a native form submission, and lets us remove a whole lot of code. This is a followup to this discussion over a year ago: https://github.com/facebook/react/pull/26674/files/5a7629ddb4f22072e37ba1ae581977ce03bdf288#r1178495317

Elaborating on that, if we're concerned about browsers that don't support it, it's important to note that:

How did you test this change?

Updated an existing test to more fully cover submitter serialization, and ran yarn test and yarn test --prod successfully.

jenseng avatar May 08 '24 18:05 jenseng