Add meta prop to Field, FastField
See original GitHub issueFeature
Current Behavior
<Field>
component, when using with a custom component or render prop, passes down the following structure to the component being rendered: { field: { name, onBlur, onChange, value }}
. Extraction of touched
and error
for a particular field has to be done manually. This becomes quite painful when dealing with deeply nested fields. For instance, when accessing errors.foo.bar
, one needs first to check the existence of errors.foo
: errors.foo && errors.foo.bar
.
Desired Behavior
Pass down the following structure: { field: { error, name, onBlur, onChange, touched, value }}
.
Info
There is at least one caveat: <input>
and other HTML elements should not receive those extra properties. It might make sense to only implement this for render prop.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:32 (8 by maintainers)
Top Results From Across the Web
Report Settings and Metadata
You will always be able to easily add the metadata along with your field data by clicking on the metadata folder. Metadata values...
Read more ><FastField /> | Formik
<FastField /> has the same exact API as <Field> , but implements ... A prop is added/removed to the <FastField name="firstName" />; The...
Read more >FastField not working as expected in Formik - Stack Overflow
I faced performance issues when i worked in a form with several fields. The behavior of Formik is to set the field value...
Read more >formik-fast-field - CodeSandbox
formik-fast-field. 0. Embed Fork Create Sandbox Sign in. Sandbox Info. formik-fast-field. 0. 1.3k. 16. wnadurskiwnadurski. Environmentcreate-react-app.
Read more ><FieldArray /> | Formik 中文文档 - Bootstrap
import React from 'react';import { Formik, Form, Field, FieldArray } from ... NOTE: In Formik v0.12 / 1.0, a new meta prop may...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My plan is to add a
meta
prop that holds these values so that ppl can still spreadfield
over an inputIt is written incorrectly in the docs.
meta
is not passed to thecomponent
. I believe it should be crossed out and marked as deprecated.