(backendOrModule)
| 14 | }); |
| 15 | |
| 16 | export const unpackBackendForEs5Users = (backendOrModule) => { |
| 17 | // Auto-detect ES6 default export for people still using ES5 |
| 18 | let backend = backendOrModule; |
| 19 | if (typeof backend === 'object' && typeof backend.default === 'function') { |
| 20 | backend = backend.default; |
| 21 | } |
| 22 | invariant( |
| 23 | typeof backend === 'function', |
| 24 | 'Expected the backend to be a function or an ES6 module exporting a default function. ' + |
| 25 | 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-drop-context.html', |
| 26 | ); |
| 27 | return backend; |
| 28 | }; |
| 29 | |
| 30 | export default function DragDropContext(backendOrModule) { |
| 31 | checkDecoratorArguments('DragDropContext', 'backend', ...arguments); // eslint-disable-line prefer-rest-params |
no outgoing calls
no test coverage detected