In React Final Form, we can use format
or parse
props for text
type inputs in order to store a different value than the one specified, but this does not seems to work the same way with checkboxes.
Example:
<FieldArray name='test' initialValue={[true, false]}>
<Field
component='input'
type='checkbox'
format={value => value ? 'foo' : null}
parse={value => value ? 'foo' : null}/>
</Field>
</FieldArray>
in this example, the value to store will still be true
or false
, regardless the use of format
and parse
. Is it possible to format values from [true, false]
to ["foo"]
?
Thanks in advance for any help.