data-driven-forms / react-forms

React library for rendering forms.
https://data-driven-forms.org/
Apache License 2.0
295 stars 85 forks source link

Can't Subscribe to Field Array Component #1457

Closed haydenlinder closed 4 months ago

haydenlinder commented 4 months ago

Scope: MUI MAPPER, MAYBE OTHERS

Description Field array values are not being updated in getState()

Schema Use this example with a Field Array like this:

const schema: Schema = {
    title: "example",
    fields: [
      {
        component: "field-array",
        name: "products",
        label: "Product section",
        initialValue: [""],
        fields: [
          {
            component: "text-field",
            name: "original",
            label: "original",
            placeholder: "original",
            isRequired: true,
            validate: [
              {
                type: "required",
              },
            ],
          },
//...

You'll see that getState().values.products[0] does not get updated with the new value as it changes.

<If it's possible, please provide a schema which reproduces the issue>

haydenlinder commented 4 months ago

Oops this was actually on me! Disregard