-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels