airjp73 / rvf

Easy form validation and state management for React and Remix
https://rvf-js.io
MIT License
840 stars 66 forks source link

[Bug]: isSubmitting for GET requests stays true after submitting a form #301

Closed justb3a closed 1 year ago

justb3a commented 1 year ago

Which packages are impacted?

What version of these packages are you using?

"@remix-validated-form/with-zod": "2.0.6", "remix-validated-form": "5.0.1",

Please provide a link to a minimal reproduction of the issue.

https://codesandbox.io/s/old-night-4m8mpr?file=/app/routes/index.tsx

Steps to Reproduce the Bug or Issue

  1. Create a ValidationForm containing an input field. Do not specify any method, so that it defaults to GET.
  2. Get the isSubmitting state, either from useFormContext or from useIsSubmitting
  3. Display a loading information when isSubmitting equals true
  4. It stays true, never-ending-loading-state…

Expected behavior

After the form has been submitted, the loading state is set to false.

I tried a rollback to

"@remix-validated-form/with-zod": "2.0.5",
"remix-validated-form": "4.6.12",

with 4.6.12 everything works as expected!.

Screenshots or Videos

No response

Platform

macOS (latest) checked in latest chrome and firefox

Additional context

No response

airjp73 commented 1 year ago

Fixed in v5.0.2! 😄

justb3a commented 1 year ago

Thanks, should have waited one more day 🙈 🤣 Now it works again as expected.