This commit is contained in:
11
node_modules/react-dnd/dist/esm/hooks/useDrag/useDragSource.js
generated
vendored
Normal file
11
node_modules/react-dnd/dist/esm/hooks/useDrag/useDragSource.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { DragSourceImpl } from './DragSourceImpl';
|
||||
export function useDragSource(spec, monitor, connector) {
|
||||
var handler = useMemo(function () {
|
||||
return new DragSourceImpl(spec, monitor, connector);
|
||||
}, [monitor, connector]);
|
||||
useEffect(function () {
|
||||
handler.spec = spec;
|
||||
}, [spec]);
|
||||
return handler;
|
||||
}
|
||||
Reference in New Issue
Block a user