1 | ;
|
2 |
|
3 | var _require = require('react-dnd'),
|
4 | DragDropContext = _require.DragDropContext;
|
5 |
|
6 | var HTML5Backend = require('react-dnd-html5-backend').default;
|
7 |
|
8 | var context = void 0;
|
9 |
|
10 | /**
|
11 | * Wrap a component in a singleton drag drop context.
|
12 | *
|
13 | * @param {React.Component} component - The component.
|
14 | *
|
15 | * @returns {React.Component} The wrapped component.
|
16 | */
|
17 | var WithDragDropContext = function WithDragDropContext(component) {
|
18 | if (!context) {
|
19 | context = DragDropContext(HTML5Backend);
|
20 | }
|
21 | return context(component);
|
22 | };
|
23 |
|
24 | module.exports = WithDragDropContext; |
\ | No newline at end of file |