final-form / final-form/react-final-form
Feature: FieldProps format/parse - access to meta object
- Dominant language
- JavaScript
- Stars
- 7.4k
- Forks
- 497
- PR merge metrics
- No merged PRs in 30d
Description
Currently `FieldProps.format` and `FieldProps.parse` do not receive `meta`. It would be handy, if they would, so you can take into accout the meta, like in this example:
```js
{
if (meta.active) {
return value;
}
// return parsed
}}
format={(value, {meta}) => {
if (meta.active) {
return value;
}
// return formatted
}}
/>
```
Or whatever meta information one would want to take into account. Currently there is an option `FieldProps.formatOnBlur` , but you already notice, there is no `FieldProps.parseOnBlur`. Introducing an option for each case is maybe the wrong approach. Like in the example above, you would not even need the `formatOnBlur` option and would allow for other use cases, you might not have think of.
Contributor guide
Assessment
This issue has not been assessed yet.