All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
11 lines
336 B
JavaScript
11 lines
336 B
JavaScript
import { useEffect, useMemo } from 'react';
|
|
import { DropTargetImpl } from './DropTargetImpl';
|
|
export function useDropTarget(spec, monitor) {
|
|
var dropTarget = useMemo(function () {
|
|
return new DropTargetImpl(spec, monitor);
|
|
}, [monitor]);
|
|
useEffect(function () {
|
|
dropTarget.spec = spec;
|
|
}, [spec]);
|
|
return dropTarget;
|
|
} |