Skip to content

Commit 5010662

Browse files
committed
eslint fixes
1 parent 8647935 commit 5010662

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/Sortable.jsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint consistent-return: 0 */
22
import PropTypes from 'prop-types';
33
import React, { Component } from 'react';
4-
import ReactDOM from 'react-dom';
54
import SortableJS from 'sortablejs';
65

76
const store = {
@@ -19,11 +18,13 @@ class Sortable extends Component {
1918
]),
2019
style: PropTypes.object
2120
};
21+
2222
static defaultProps = {
2323
options: {},
2424
tag: 'div',
2525
style: {}
2626
};
27+
2728
sortable = null;
2829

2930
componentDidMount() {
@@ -84,20 +85,29 @@ class Sortable extends Component {
8485

8586
this.sortable = SortableJS.create(this.node, options);
8687
}
88+
8789
componentWillUnmount() {
8890
if (this.sortable) {
8991
this.sortable.destroy();
9092
this.sortable = null;
9193
}
9294
}
93-
render() {
94-
const { tag: Component, ...props } = this.props;
9595

96-
delete props.options;
97-
delete props.onChange;
96+
render() {
97+
const {
98+
tag: Component,
99+
options, // eslint-disable-line
100+
onChange, // eslint-disable-line
101+
...props
102+
} = this.props;
98103

99104
return (
100-
<Component {...props} ref={(node) => { return this.node = node; }} />
105+
<Component
106+
{...props}
107+
ref={node => {
108+
this.node = node;
109+
}}
110+
/>
101111
);
102112
}
103113
}

0 commit comments

Comments
 (0)