question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add meta prop to Field, FastField

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:9
  • Comments:32 (8 by maintainers)

github_iconTop GitHub Comments

9reactions
jaredpalmercommented, Jan 12, 2018

My plan is to add a meta prop that holds these values so that ppl can still spread field over an input

8reactions
benesva4commented, Jan 18, 2020

It is written incorrectly in the docs. meta is not passed to the component. I believe it should be crossed out and marked as deprecated.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found