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'.
In previous version We have an ability to import Form from formik package
For some reason in generated types we have export default Form;

| Software | Version(s) |
| ---------------- | ---------- |
| Formik | 2.0.1-rc.7 |
| React | 16.8.6 |
| TypeScript | 3.5.1 |
| Operating System | macOS 10.14.5 |
I am seeing the exact same behavior [email protected]
+1
tmp fix by commenting export default Form directly in node_modules/formik/Form.d.ts...
This is because of https://github.com/microsoft/TypeScript/issues/31676
The solution for now is to downgrade typescript to 3.4.x.
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;
}
Typescript 3.5.3 is released and fixes this issue 馃帀
Going to deprecate that release and rebuild with 3.5.3
Most helpful comment
Typescript 3.5.3 is released and fixes this issue 馃帀
See microsoft/TypeScript#31676