You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest to make the return statement of form.submit() unified for all its branching.
Why
Current behavior
Now calling form.submit() returns two different things based on the validity of a form:
Returns undefined if a form is invalid.
Returns Promise<response> after the dispatched action.
Expected behavior
Calling form.submit() always returns a Promise, which executes its .catch() chain if a form is invalid or its action Promise rejects, and returns the async action in the .then() call if its valid (as it does now).
Watch out for the call signature of those scenarios. When a form is invalid, it may expose a different set of argument to the .catch() hook, then if the async action rejects. Can this be unified as well?
The text was updated successfully, but these errors were encountered:
What
I suggest to make the return statement of
form.submit()
unified for all its branching.Why
Current behavior
Now calling
form.submit()
returns two different things based on the validity of a form:undefined
if a form is invalid.Promise<response>
after the dispatchedaction
.Expected behavior
Calling
form.submit()
always returns a Promise, which executes its.catch()
chain if a form is invalid or its action Promise rejects, and returns the async action in the.then()
call if its valid (as it does now).The text was updated successfully, but these errors were encountered: