Skip to content

Commit

Permalink
Add html5DragDropContext to initilize HTML5Backend only once
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmahajan7 committed Feb 16, 2018
1 parent a4b3c87 commit 305367b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
import html5DragDropContext from '../shared/html5DragDropContext';
import DraggableHeaderCell from './DraggableHeaderCell';

class DraggableContainer extends React.Component {
Expand All @@ -27,4 +26,4 @@ DraggableContainer.propTypes = {
children: PropTypes.element
};

export default DragDropContext(HTML5Backend)(DraggableContainer);
export default html5DragDropContext(DraggableContainer);
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {Component} from 'react';
import HTML5Backend from 'react-dnd-html5-backend';
import { DragDropContext } from 'react-dnd';
import html5DragDropContext from '../shared/html5DragDropContext';
import DraggableHeaderCell from './DraggableHeaderCell';
import RowDragLayer from './RowDragLayer';
import { utils } from 'react-data-grid';
Expand Down Expand Up @@ -41,4 +40,4 @@ DraggableContainer.propTypes = {
getDragPreviewRow: PropTypes.func
};

export default DragDropContext(HTML5Backend)(DraggableContainer);
export default html5DragDropContext(DraggableContainer);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';

export default DragDropContext(HTML5Backend);

0 comments on commit 305367b

Please sign in to comment.