Hi, before my question I want to thank you for your great library and your efforts to support and keep it updated.
I have a custom field array which its default values are set from other components based on some conditions. For example, in this sandbox, it is based on the text field if the value given is '3'.
It works fine if I want to set/replace the whole field array with a given value but how can I append to it?
in the example provided, the field array initial values are 1 -> one and 2 -> two or whatever user type, and I want to append the 3->three if I write 3 in the text field, how can I achieve this?
Hi, before my question I want to thank you for your great library and your efforts to support and keep it updated.
I have a custom field array which its default values are set from other components based on some conditions. For example, in this sandbox, it is based on the text field if the value given is '3'. It works fine if I want to set/replace the whole field array with a given value but how can I append to it?
in the example provided, the field array initial values are 1 -> one and 2 -> two or whatever user type, and I want to append the 3->three if I write 3 in the text field, how can I achieve this?
Code Exaple: codesandbox
Thanks
Originally posted by @Ali-Zmn in https://github.com/data-driven-forms/react-forms/discussions/1319
Required format:
The
set
attribute should be either an object or a function that returns desired object.Function result should be extracted here and added to the state: https://github.com/data-driven-forms/react-forms/blob/master/packages/react-form-renderer/src/condition/condition.js#L48