You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uncaught Invariant Violation: Expected the drop target specification to only have some of the following keys: canDrop, hover, drop. Instead received a specification with an unexpected "beginDrag" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html
Here's my relevant code (I call card, kanban_deck):
**kanban_deck.es6.jsx:
import React, { Component, PropTypes } from 'react';
import { DragSource, DropTarget } from 'react-dnd';
import constants from './constants';
I'm getting the following error:
Uncaught Invariant Violation: Expected the drop target specification to only have some of the following keys: canDrop, hover, drop. Instead received a specification with an unexpected "beginDrag" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html
Here's my relevant code (I call card, kanban_deck):
**kanban_deck.es6.jsx:
import React, { Component, PropTypes } from 'react';
import { DragSource, DropTarget } from 'react-dnd';
import constants from './constants';
const deckDragSpec = {
beginDrag(props) {
return {
id: props.id,
status: props.status
};
},
endDrag(props) {
props.deckCallbacks.persistDeckDrag(props.id, props.status);
}
}
const deckDropSpec = {
hover(props, monitor) {
const draggedId = monitor.getItem().id;
props.deckCallbacks.updatePosition(draggedId, props.id);
}
}
let collectDrag = (connect, monitor) => {
return {
connectDragSource: connect.dragSource()
};
}
let collectDrop = (connect, monitor) => {
return {
connectDropTarget: connect.dropTarget(),
};
}
class KanbanDeck extends Component {
constructor() {
super(...arguments);
this.state = {
showDetails: false
};
// var str = JSON.stringify(this.props, null, 4);
// console.log(str);
}
render() {
const { connectDragSource, connectDropTarget } = this.props;
}
}
KanbanDeck.propTypes = {
id: PropTypes.number,
name: PropTypes.string,
description: PropTypes.string,
color: PropTypes.string,
deckCallbacks: PropTypes.object,
connectDragSource: PropTypes.func.isRequired,
connectDropTarget: PropTypes.func.isRequired
};
const dragHighOrderDeck = DragSource(constants.KANBANDECK, deckDragSpec, collectDrag)(KanbanDeck);
const dragDropHighOrderDeck = DropTarget(constants.KANBANDECK, deckDragSpec, collectDrop)(dragHighOrderDeck);
export default dragDropHighOrderDeck
teee
`
The text was updated successfully, but these errors were encountered: