react-final-form-arrays

Providing initialValues for an array in final-form-arrays causes state changes to reset the whole form, how can i prevent this?

三世轮回 提交于 2021-02-07 19:23:58
问题 I have a form that uses final-form-arrays. The form works and validation works, however, when i make a state change inside the component, it resets all my values. I was able to replicate the issue with the same example that react-final-form-arrays provides: https://codesandbox.io/embed/react-final-form-field-arrays-om6p6 I added a button to toggle a state change. Essentially, just try filling values in the form, and then change the state. The form will reset, and i cant figure out why that is

How do I combine `final-form-calculate` with `final-form-array`

强颜欢笑 提交于 2020-05-15 10:05:08
问题 I have a form which uses react-final-form-array in order to have many "Attendees". I'm wanting each of the Attendee.Email inputs to do a web lookup and then set the Attendee.FirstName and Attendee.Surname based off the result. I'm not sure how this should be expressed with a final-form-calculate decorator. Specifically, I don't know how to reference the individual form item within the array. Here's what I've got as a start: const MyForm = props => { const calculator = createDecorator( { field

How do I combine `final-form-calculate` with `final-form-array`

一个人想着一个人 提交于 2020-05-15 10:04:08
问题 I have a form which uses react-final-form-array in order to have many "Attendees". I'm wanting each of the Attendee.Email inputs to do a web lookup and then set the Attendee.FirstName and Attendee.Surname based off the result. I'm not sure how this should be expressed with a final-form-calculate decorator. Specifically, I don't know how to reference the individual form item within the array. Here's what I've got as a start: const MyForm = props => { const calculator = createDecorator( { field

Conditional dropdowns with react-select in react-final-form initialized from the state

非 Y 不嫁゛ 提交于 2020-01-01 18:19:28
问题 I'm using react-select and react-final-form for conditional dropdowns, where options for the second select are provided by a <PickOptions/> component based on the value of the first select (thanks to this SO answer). Here is the component: /** Changes options and clears field B when field A changes */ const PickOptions = ({ a, b, optionsMap, children }) => { const aField = useField(a, { subscription: { value: 1 } }); const bField = useField(b, { subscription: {} }); const aValue = aField

Angular 5 FormArray get data from database and show rows

拈花ヽ惹草 提交于 2019-12-19 11:24:09
问题 I am just a newbie to angular. I have create a event component where user enters the event name with packages. When user creates an event it has the functionality for creating multiple packages with add and remove row. For that I have used FormArray . Everything is fine here. But when I am trying to get those values in event edit component I am getting the value of event name but when I am trying to get the packages details I am little bit confused in showing rows with filled values. Here is