-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create <Field as> and deprecate <Field component> and <Field render> #1406
Conversation
); | ||
|
||
warning( | ||
component && children && isFunction(children), | ||
'You should not use <Field component> and <Field children> as a function in the same <Field> component; <Field component> will be ignored.' | ||
!!is && !!children && isFunction(children), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since line 94 defaulted https://github.com/jaredpalmer/formik/pull/1406/files#diff-bc78961df770c0df68f6cd758a6f2afdR94 as
to input
, wouldn't this error message show up every time the dev does this?
<Field name="name">
{({form, field}) => {
return <MyCustomInput {...field} />
}}
</Field>
In the example above, as would default to input
. In this case, would the check be something like as !== 'input'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaredpalmer Why we Field render will be deprecated.
Recently, we started using Field render in project. Formik 1.5.8
Please update API examples, if formik going to change ?
<Field component>
and<Field render>
. These haven't been removed. However, they will yield a warning in the console.<Field as>
prop which just passes related handlers and props straight through. This should make Styled Components folks happy.Related to #1371
Closes #1407
Closes #1408