0

I am currently getting this error when importing react-dnd:

Could not find a declaration file for module 'react-dnd'. 'node_modules/react-dnd/lib/index.js' implicitly has an 'any' type.
Try `npm install @types/react-dnd` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-dnd';

Doesn't react-dnd provide type definitions? Is there anything extra I have to do to get access to the types?

I am using typescript in strict mode. My app was scaffolded with create-react-app.

1 Answer 1

2

react-dnd does indeed ship with type definitions as you can see here in unpkg. You shouldn't need to do anything to access these types. Perhaps you are using an older version of react-dnd that does not have the types included?

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, I was on version 2.6 instead of 11.1! I cloned a really old example from github...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.