Skip to content

Instantly share code, notes, and snippets.

@arackaf
Last active December 19, 2016 18:04
Show Gist options
  • Save arackaf/d87b7161279e27dddaff3b7ea6986af0 to your computer and use it in GitHub Desktop.
Save arackaf/d87b7161279e27dddaff3b7ea6986af0 to your computer and use it in GitHub Desktop.
import {DragSource, DragDropContext, DropTarget, DragLayer} from 'react-dnd';
@connect((state, ownProps) => {
let subjectsModule = state.subjectsModule,
//...
return {
//........
}
}, {...actionCreators})
@DragSource('subject', {
beginDrag: props => {
props.beginDrag(props.subject._id);
return props.subject;
},
endDrag: props => {
props.clearSubjectDragging();
}
}, (connect, monitor) => ({
connectDragSource: connect.dragSource(),
connectDragPreview: connect.dragPreview()
}))
class SubjectDisplayContent extends Component {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment