-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I add extraError prop in react, the form refreshes its state #4355
Comments
Hi @inspiring71, the form refreshes its state because it rerenders when you call |
Thanks @abdalla-rko , both for the tip and the attached sandbox. As you know your ways around this library better than me, I was wondering if there is any straightforward way to get the field path of an input when onBlur event is called? I found a hack that works fine for now, but it seems like finding the field path of the element that invoked the event should be more straight forward. Any idea? |
@inspiring71 you can use the idSeparator prop on the form to change to use a Also, all of the |
Thanks for the response @heath-freenome . I will try |
Prerequisites
What theme are you using?
core
Version
5.x
Current Behavior
When the extraError prop is passed to the Form component, any updates to extraError cause the library to remove all dynamically added array fields and refresh the UI components unexpectedly.
Screen.Recording.2024-10-29.at.11.19.36.AM.mov
You can find the check the example code here:
https://codesandbox.io/p/devbox/2gvwxk
Expected Behavior
I expect the fields to remain on the page and not disappear.
Steps To Reproduce
extraError
prop to the Form component.Environment
Anything else?
I was trying to implement this feature when face with this error:
#617 (comment)
Also, Let me thank you for all the hard works, I know it is not easy to be an OSS developer.
BTW, I am willing to fix the issue myself but as I am new to this repo, needs some pointers on where this problem is originated.
The text was updated successfully, but these errors were encountered: