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

Method addTarget

packages/dnd-core/src/HandlerRegistry.js:81–88  ·  view source on GitHub ↗
(type, target)

Source from the content-addressed store, hash-verified

79 }
80
81 addTarget(type, target) {
82 validateType(type, true);
83 validateTargetContract(target);
84
85 const targetId = this.addHandler(HandlerRoles.TARGET, type, target);
86 this.store.dispatch(addTarget(targetId));
87 return targetId;
88 }
89
90 addHandler(role, type, handler) {
91 const id = getNextHandlerId(role);

Callers 3

registerTargetFunction · 0.80

Calls 4

addHandlerMethod · 0.95
addTargetFunction · 0.90
validateTypeFunction · 0.85
validateTargetContractFunction · 0.85

Tested by

no test coverage detected