MCPcopy Create free account
hub / github.com/react-dnd/react-dnd / validateTargetContract

Function validateTargetContract

packages/dnd-core/src/HandlerRegistry.js:18–22  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

16}
17
18function validateTargetContract(target) {
19 invariant(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');
20 invariant(typeof target.hover === 'function', 'Expected hover to be a function.');
21 invariant(typeof target.drop === 'function', 'Expected beginDrag to be a function.');
22}
23
24function validateType(type, allowArray) {
25 if (allowArray && isArray(type)) {

Callers 1

addTargetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected