-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add FieldProps change to v2 migration guide #2356
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
Add FieldProps change to v2 migration guide #2356
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/jared/formik-docs/jwgjt332l |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d359954:
|
FieldProps had an undocumented breaking change. This change has now been added to the v1 to v2 migration guide.
d8558c9
to
77d894f
Compare
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.
Small nitpick, otherwise looks good to me.
docs/migrating-v2.md
Outdated
@@ -56,6 +58,22 @@ import { FormikActions } from 'formik'; | |||
import { FormikHelpers as FormikActions } from 'formik'; | |||
``` | |||
|
|||
#### `FieldProps` | |||
|
|||
**`FieldProps` now accepts two generic type parameters.** Both are optional but `FormValues` needs to be passed as the second parameter. |
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.
"Both parameters are optional, but FormValues
has been moved from the first to the second parameter."
The wording currently sounds like "it's optional but needs to be passed."
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.
Would be great to elaborate what FieldValue
means
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.
@johrom: absolutely, I'll update.
@jorilallo: I agree it would be good, but I think it would be better to link into the TypeScript docs. However, it doesn't contain a description of those types.
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.
@mhienle to be clear, I was going through the docs and I had no idea what FieldValue
meant, yet alone that it's from TS definitions itself, so an example would not hurt. Same for the actual docs, there's not a single example
Edit: Even in Formik's definitions it's just V = any
which doesn't explain anything
LGTM |
Thanks @jorilallo |
FieldProps
had an undocumented breaking change introduced in v2. For users that relied on the previously unary type generic, theFormValues
parameter ended up as the type onfield.value
.This PR adds documentation for this change in the v1 to v2 migration guide. This fixes #2350
FieldProps
in v1.6.8:FieldProps
in v2.1.4:View rendered docs/migrating-v2.md