Fix isSubmitting formState when encType is application/json for Remix.run#169
Conversation
|
Awesome work, Thank you, i'll test this out just to confirm and release it asap, would you also consider porting it to the latest release? |
|
@AlemTuzlak Yea id be happy to port it to the latest release if you are good with the change |
|
@AlemTuzlak I noticed that this branch is only compatible with react-hook-form <= 7.54.x but the peer dependency is specified as ^7.55.0. If you install the correct react-hook-form branch then everything works but a straight up npm install from a fresh state the RemixFormProvider will be broken due to the incompatible version. Should I update the peer dependency specifier to specify the compatible versions or should I backport the fixes. |
|
@BobReid that would be great, I just merged this PR so we can release it, feel free to open up a new one for the backport! |
Description
This PR fixes a bug where the form isSubmitting state is not tracked properly when using
encType: 'application/json'.The issue is that the hook only considers navigation / fetcher formData when calculating that a submission is happening. formData is always undefined when using application/json and navigation / fetcher json is populated with the equivalent data.
Fixes #168
If this is a new feature please add a description of what was added and why below:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: