Identifier import type error : Cannot find module 'dnd-core' or its corresponding type declarations
I was following the simple sortable example at https://react-dnd.github.io/react-dnd/examples/sortable/simple, it's working but i'm getting this error whem trying to import the Identifier type import type { Identifier } from 'dnd-core'; Cannot find module 'dnd-core' or its corresponding type declarations
i'm using:
- NextJs 13.0.2
- React : 18.2.0
- React-dnd: 16.0.1
- React-dnd-html5-backend: 16.0.1
- Pnpm : 7.16.0
- Typescript: 4.8.4
I guess, you would need to add dnd-core as a dependency in your app. react-dnd depends on it itself (so it is already in your node_modules), but you don't have it in the scope of your app, so you have a TS error.
This shows as an error in the example linked from the site:
This is what I have used..
pnpm add dnd-core -D