Add meta prop to Field, FastField
Author: DremoraCreated Jan 12, 2018Updated Dec 2, 2025
LabelsType: EnhancementPriority: Mediumpinned
Feature
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.
Source: jaredpalmer/formik