I'm trying to use dnd-multi-backend with DndProvider of react-dnd as described in dnd-multi-backend documentation and i'm getting a compilation error because of different types from what
DndProvider is expected.
import { DndProvider } from 'react-dnd';
import MultiBackend from 'react-dnd-multi-backend';
import Html5toTouch from 'react-dnd-multi-backend/lib/HTML5toTouch';
<DndProvider backend={MultiBackend} options={Html5toTouch}>
// ...
</DndProvider>
Failed to compile:
Type '{ children: Element[]; backend: (backends: Backends) => BackendFactory; options: Backends; }' is not assignable to type '(IntrinsicAttributes & { manager: DragDropManager; } & { children?: ReactNode; }) | (IntrinsicAttributes & { backend: BackendFactory; context?: any; options?: any; debugMode?: boolean | undefined; } & { ...; })'.
Type '{ children: Element[]; backend: (backends: Backends) => BackendFactory; options: Backends; }' is not assignable to type '{ backend: BackendFactory; context?: any; options?: any; debugMode?: boolean | undefined; }'.
Types of property 'backend' are incompatible.
Type '(backends: Backends) => BackendFactory' is not assignable to type 'BackendFactory'.
Types of parameters 'backends' and 'manager' are incompatible.
Property 'backends' is missing in type 'DragDropManager' but required in type 'Backends'.
"dependencies": {
"@types/react": "^16.8.19",
"@types/react-dnd": "^3.0.2",
"@types/react-dnd-html5-backend": "^3.0.2",
"@types/react-dnd-multi-backend": "^3.0.5",
"@types/react-dom": "^16.8.4",
"@types/react-router-dom": "^4.3.3",
"react": "^16.8.6",
"react-dnd": "^9.3.4",
"react-dnd-multi-backend": "^3.2.2",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
},