Formik: Could not find a declaration file for module 'prop-types'

Created on 17 Dec 2017  路  7Comments  路  Source: formium/formik

I've created a new project using create-react-app-typescript and added the simple Formik example from the readme but I got a compile error right away:

error TS7016: Could not find a declaration file for module 'prop-types'.

I think this is due to the @types/prop-types package being included in Formik's devDependencies and not dependencies. Based on the TypeScript publishing doc, it seems like including the dependency in dependencies would be an appropriate way to manage it and should resolve this issue. Unfortunately, non-TS projects would bring down the dependency, but the alternative is requiring TS projects to manage a dependency their code doesn't depend on.

Most helpful comment

This is still happening.

All 7 comments

Same issue here...

Same issue here

@jaredpalmer Would you accept a PR for this, or are you opposed to adding @types/prop-types to dependencies?

I guess i'd rather document it in master (right after the install instructions), and then just spend our energy moving to create-react-context so we can drop prop-types all together.

This is still happening.

I was able to resolve this by installing @types/prop-types

same issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredpalmer picture jaredpalmer  路  3Comments

jeffbski picture jeffbski  路  3Comments

Jucesr picture Jucesr  路  3Comments

jaredpalmer picture jaredpalmer  路  3Comments

dearcodes picture dearcodes  路  3Comments