1+ /* eslint consistent-return: 0 */
12import PropTypes from 'prop-types' ;
23import React , { Component } from 'react' ;
34import ReactDOM from 'react-dom' ;
4- import Sortable from 'sortablejs' ;
5+ import SortableJS from 'sortablejs' ;
56
67const store = {
78 nextSibling : null ,
89 activeComponent : null
910} ;
1011
11- module . exports = class extends Component {
12+ class Sortable extends Component {
1213 static propTypes = {
1314 options : PropTypes . object ,
1415 onChange : PropTypes . func ,
@@ -75,10 +76,10 @@ module.exports = class extends Component {
7576 setTimeout ( ( ) => {
7677 eventHandler && eventHandler ( evt ) ;
7778 } , 0 ) ;
78- }
79+ } ;
7980 } ) ;
8081
81- this . sortable = Sortable . create ( ReactDOM . findDOMNode ( this ) , options ) ;
82+ this . sortable = SortableJS . create ( ReactDOM . findDOMNode ( this ) , options ) ;
8283 }
8384 componentWillUnmount ( ) {
8485 if ( this . sortable ) {
@@ -87,7 +88,15 @@ module.exports = class extends Component {
8788 }
8889 }
8990 render ( ) {
90- const { children, className, tag, style } = this . props ;
91- return React . DOM [ tag ] ( { className, style } , children ) ;
91+ const { tag : Component , ...props } = this . props ;
92+
93+ delete props . options ;
94+ delete props . onChange ;
95+
96+ return (
97+ < Component { ...props } />
98+ ) ;
9299 }
93100}
101+
102+ export default Sortable ;
0 commit comments