Skip to content
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 formik to the user suite #21381

Merged
merged 2 commits into from
Feb 1, 2018
Merged

Conversation

weswigham
Copy link
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