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

Unable to import Form in formik@2.0.1-rc.7 #1631

Closed
emahnovets opened this issue Jun 23, 2019 · 6 comments · Fixed by #1663
Closed

Unable to import Form in formik@2.0.1-rc.7 #1631

emahnovets opened this issue Jun 23, 2019 · 6 comments · Fixed by #1663

Comments

@emahnovets
Copy link

🐛 Bug report

Current Behavior

Got an error when trying to import Form component from fomik package. Like this:

import { Formik, Form } from 'formik';
semantic error TS2305 Module '"../node_modules/formik/dist"' has no exported member 'Form'.

Expected behavior

In previous version We have an ability to import Form from formik package

Additional context

For some reason in generated types we have export default Form;
Screen Shot 2019-06-23 at 1 11 54 PM

Your environment

Software Version(s)
Formik 2.0.1-rc.7
React 16.8.6
TypeScript 3.5.1
Operating System macOS 10.14.5
@nareshbhatia
Copy link
Contributor

I am seeing the exact same behavior formik@2.0.1-rc.7

@aleksanderd
Copy link

aleksanderd commented Jun 24, 2019

+1
tmp fix by commenting export default Form directly in node_modules/formik/Form.d.ts...

@targos
Copy link

targos commented Jun 25, 2019

This is because of microsoft/TypeScript#31676

The solution for now is to downgrade typescript to 3.4.x.

@strothj
Copy link

strothj commented Jul 3, 2019

I was able to augment the declaration for now:
formik.d.ts:

import { FormikFormProps } from "formik";

declare module "formik" {
  export function Form(props: FormikFormProps): JSX.Element;
}

@meredithlind
Copy link

Typescript 3.5.3 is released and fixes this issue 🎉

See microsoft/TypeScript#31676

@jaredpalmer
Copy link
Owner

Going to deprecate that release and rebuild with 3.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants