-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: FormEncType
type is missing newly supported application/json
#10646
Comments
@nicksrandall
|
Interesting. It's explicitly suggested in the Remix v1.18 release notes, so either the note is wrong, or the type wasn't updated as needed. https://github.com/remix-run/remix/releases/tag/remix%401.18.0 |
I'm wondering if that's a design error on Remix's part. The spec only lists three possible values for encType, so But at the same time, the There's probably a middle ground here. I'm not sure if the discussion should live here or the Remix repo. But it's probably worth discussing. |
I don't think it's a spec issue. The whole point of allowing Technically I think it should allow any |
@nicksrandall Can you double check your local setup and/or provide a reproduction?
Locally this works as expected for me using 6.14.0: As noted above, |
@kiliman That's not a bad idea, and would be pretty minor changes to allow - give us a string body and we'll just send whatever |
I closed this issue because I realized my setup was wrong. That said, I wish the type signature of submit was narrowed by encType. |
What version of React Router are you using?
6.14
Steps to Reproduce
Try to use
Fetcher.submit
in a TS environment withencType: "application/json"
Expected Behavior
New encTypes would be allowed by TS
Actual Behavior
TS complains because types are missing.
The text was updated successfully, but these errors were encountered: