| 61 | } |
| 62 | |
| 63 | drop() { |
| 64 | if (!spec.drop) { |
| 65 | return undefined; |
| 66 | } |
| 67 | |
| 68 | const dropResult = spec.drop(this.props, this.monitor, this.component); |
| 69 | if (process.env.NODE_ENV !== 'production') { |
| 70 | invariant( |
| 71 | typeof dropResult === 'undefined' || |
| 72 | isPlainObject(dropResult), |
| 73 | 'drop() must either return undefined, or an object that represents the drop result. ' + |
| 74 | 'Instead received %s. ' + |
| 75 | 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', |
| 76 | dropResult, |
| 77 | ); |
| 78 | } |
| 79 | return dropResult; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | return function createTarget(monitor) { |