({ namespace, ...props })
| 8 | import PropTypes from 'prop-types'; |
| 9 | |
| 10 | export 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 | |
| 28 | DragSource.propTypes = { |
| 29 | namespace: PropTypes.any.isRequired, |
nothing calls this directly
no outgoing calls
no test coverage detected