Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @akinwale Can you please explain the reason for
formState
prop? Good catch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
formState
contains theisLoading
property, which indicates whether or not the form is loading after submitting. When I was testing, I noticed the button loading state wasn't being updated, which was due to theformState
not being properly forwarded.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Now, it is giving me a feeling that there might be more such issues in this refactor. Anyways, thanks for the details. I will test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I wonder what would be the desired way of using the
formState
, because I see that originally it is taken from onyx in both:FormProvider
andFormWrapper
. After the suggested change we'll have twoformState
props overriding each other inFormWrapper
- one passed as a direct prop, the second taken from onyx. I think it may cause some problems, what do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't notice the formState coming from Onyx. I guess I was just seeing some odd behaviour with the loading state when I was testing. I'll update and run some more tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Not sure why I was seeing issues with loading earlier, but I cleared my browser caches and re-logged in just to make sure. Everything tests ok now.