reactjsreact-final-formreact-final-form-arrays

access mutators from Field input


I have custom mutators to handle Slider value changes in react-final-form, like this example. However, I want to have a function that generates Field/FieldArray in a Wizard, like this example. In FieldArray render function I can access arrayMutators and another custom mutator from fields variable. I couldn't find these mutators in the input variable from Field.

Is there a way to access custom mutators from input or access form.mutator in Wizard from the parent?


Solution

  • That Slider example is a misuse of mutators. That <SliderField/> could be done with just a <Field/> component.

    Edit Wizard-Example

    Mutators live on the form. If you really need to get at them, you can use the useForm() hook.