Skip to content

Add formik to the user suite#21381

Merged
weswigham merged 2 commits into
microsoft:masterfrom
weswigham:add-formik
Feb 1, 2018
Merged

Add formik to the user suite#21381
weswigham merged 2 commits into
microsoft:masterfrom
weswigham:add-formik

Conversation

@weswigham
Copy link
Copy Markdown
Member

@weswigham weswigham commented Jan 24, 2018

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 for Values, 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) with ExtraProps = {}, Values = object and everywhere Props is referenced today, instead writing FormikConfig<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.

@weswigham weswigham merged commit 421c927 into microsoft:master Feb 1, 2018
@weswigham weswigham deleted the add-formik branch February 1, 2018 20:52
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants