MCPcopy Create free account
hub / github.com/decaporg/decap-cms / DragSource

Function DragSource

packages/decap-cms-core/src/components/UI/DragDrop.js:10–26  ·  view source on GitHub ↗
({ namespace, ...props })

Source from the content-addressed store, hash-verified

8import PropTypes from 'prop-types';
9
10export function DragSource({ namespace, ...props }) {
11 const DragComponent = ReactDNDDragSource(
12 namespace,
13 {
14 // eslint-disable-next-line no-unused-vars
15 beginDrag({ children, isDragging, connectDragComponent, ...ownProps }) {
16 // We return the rest of the props as the ID of the element being dragged.
17 return ownProps;
18 },
19 },
20 connect => ({
21 connectDragComponent: connect.dragSource(),
22 }),
23 )(({ children, connectDragComponent }) => children(connectDragComponent));
24
25 return React.createElement(DragComponent, props, props.children);
26}
27
28DragSource.propTypes = {
29 namespace: PropTypes.any.isRequired,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected