Skip to content

When I add extraError prop in react, the form refreshes its stateΒ #4355

@inspiring71

Description

@inspiring71

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

  1. Pass the extraError prop to the Form component.
  2. Provide a schema with an array.
  3. Add a couple of array elements
  4. Update the extraError value.
  5. Observe that all previously added array fields are removed, and the UI refreshes.

Environment

- OS: Mac and Ubuntu
- Node: 22.2
- npm: 10.7

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions