Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Formik's
.d.ts
typechecks on its own now, however its example fails. There are two compounding reasons for this. The first is that formik's type parameters for its tag do not have an inference site forValues
, so it becomes the default. This can be fixed in formik by replacing the type parameter declarations (Props extends FomikConfig<Values> = FormikConfig<Values>, Values = object
) withExtraProps = {}, Values = object
and everywhereProps
is referenced today, instead writingFormikConfig<Values> & ExtraProps
. That would be how you can achieve the desired inferences for an equivalent call, anyway. Which leads me to the second reason: In JSX, this pattern is presently broken because our JSX type calculation code aggressively gets the apparent type of types it uses to construct the attributes type - contrary to what we'd like for appropriate contextual typing (since the apparent type replaces type parameters with their constraints, preventing us from drawing inferences). I've put a PR up to fix that at #21383, but quickinfo is can still be wrong because of #21382.