Error when using the `as` prop on <Field>
See original GitHub issueBackground
The component
and render
props are deprecated in Formik in favor of as
: https://github.com/formik/formik/pull/1406
Issue
I tried to use as
like this:
import { Field, Form, Formik } from 'formik';
import { TextField } from 'formik-material-ui';
...
<Field
as={TextField}
...
which produces this error:
Not really sure what’s going on here. Using as
with plain Formik and MUI works without errors.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Giving error when sending props in react typescript
I'm assuming you're not declaring AddToCart 's props properly (no pun intended). Your code should look something like this:
Read more >TextInput: Using error prop function with placeholder prop set ...
Hi @victorbutler, Error prop pops up 'on the go', e.g. text validation. In your case we are manually toggling empty inputs, which are...
Read more >Examples - Final Form Docs
Introduces field-level validation functions and demonstrates how to display errors next to fields using ... Independent Error Component (with Render Props).
Read more ><Field /> | Formik
When you are not using a custom component and you need to access the underlying DOM node created by Field (e.g. to call...
Read more >Troubleshooting | React Navigation
Troubleshooting. This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation.
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 FreeTop 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
Top GitHub Comments
#2618 might be worth following here as it’ll confirm whether the
component
-being-deprecated note was just a mistake or not. I’m not getting any warnings for it unlikerender
.Thanks @dsgriffin, I dont think there is anything to be done here in the library