import TouchBackend from 'react-dnd-touch-backend';
import { DragDropContext } from 'react-dnd';

export default DragDropContext(TouchBackend({ enableMouseEvents: true }));

import TouchBackend from 'react-dnd-touch-backend';
import HTML5Backend from 'react-dnd-html5-backend';
import { DragDropContext } from 'react-dnd';

const isTouchDevice = 'ontouchstart' in window || navigator.msMaxTouchPoints;
const backend = isTouchDevice ? TouchBackend({ enableMouseEvents: true }) : HTML5Backend;

export default DragDropContext(backend);

Use different react-dnd backends for touch devices and desktops
Use different react-dnd backends for touch devices and desktops
