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
This is a food for thought for all devs that use this. If my form is mounted, and it resolves, then I want to navigate to the next screen. So currently I am abusing the getPayload prop for this behavior:
getPayload={handleSubmission}
const handleSubmission = payload => {
setTimeout(() => {
// payload is undefined for success, else its SubmissionErrors for final-form
if (payload === undefined) {
navigate('ScreenAfterLogin');
}
}, 0);
}
I don't navigate from redux, because after the login flow its not always necessary to navigate('ScreenAfterLogin'). For instance, if during the user using the app, his cookie expires, I show a "relogin screen", and on success there I send him navigation.back().
Aside: I am guessing I have to wrap in setTimeout, so I let the form take the changes, otherwise i get component is not mounted anymore errors.
The text was updated successfully, but these errors were encountered:
Noitidart
changed the title
Brainstorm for all dev consumers: onResolve prop?
Brainstorm for all dev consumers: onResolve/onHandleSubmission prop?
Apr 20, 2019
This is a food for thought for all devs that use this. If my form is mounted, and it resolves, then I want to
navigate
to the next screen. So currently I am abusing thegetPayload
prop for this behavior:I don't navigate from redux, because after the login flow its not always necessary to
navigate('ScreenAfterLogin')
. For instance, if during the user using the app, his cookie expires, I show a "relogin screen", and on success there I send himnavigation.back()
.Aside: I am guessing I have to wrap in setTimeout, so I let the form take the changes, otherwise i get component is not mounted anymore errors.
The text was updated successfully, but these errors were encountered: