Skip to content

Commit 95df0dd

Browse files
author
Wayne Van Son
committed
[misc] removes console.logs, imports and unused variables
1 parent c680c00 commit 95df0dd

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/react-sortable.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {
77
ReactElement,
88
RefObject
99
} from "react";
10-
import Sortable, { MoveEvent, Options, SortableEvent, Swap } from "sortablejs";
10+
import Sortable, { MoveEvent, Options, SortableEvent } from "sortablejs";
1111
import {
1212
AllMethodsExceptMove,
1313
HandledMethodNames,
14+
ItemInterface,
1415
ReactSortableProps,
1516
Store,
16-
UnHandledMethodNames,
17-
ItemInterface
17+
UnHandledMethodNames
1818
} from "./types";
1919
import { destructurePropsForOptions, insertNodeAt, removeNode } from "./util";
2020

@@ -55,7 +55,7 @@ export class ReactSortable<T extends ItemInterface> extends Component<
5555

5656
render() {
5757
const { tag, style, className, id } = this.props;
58-
const classicProps = { style, className,id };
58+
const classicProps = { style, className, id };
5959

6060
/** if no tag, default to a `div` element */
6161
const newTag = !tag || tag === null ? "div" : tag;
@@ -87,7 +87,6 @@ export class ReactSortable<T extends ItemInterface> extends Component<
8787
if (!children || children == null) return null;
8888

8989
const dataid = dataIdAttr || "data-id";
90-
const className = "";
9190

9291
return Children.map(children as ReactElement<any>[], child =>
9392
cloneElement(child, {
@@ -276,8 +275,8 @@ export class ReactSortable<T extends ItemInterface> extends Component<
276275
insertNodeAt(evt.from, curr.element, curr.oldIndex)
277276
);
278277

279-
const { list, setList } = this.props;
280-
const newState: T[] = [...list];
278+
const { list, setList } = this.props;
279+
const newState: T[] = [...list];
281280

282281
newOldIndices
283282
// remove old items in state, starting from the end.
@@ -320,7 +319,6 @@ export class ReactSortable<T extends ItemInterface> extends Component<
320319
/** @todo */
321320
onSelect(evt: SortableEvent) {
322321
const { oldIndex, newIndex } = evt;
323-
console.log({ oldIndex, newIndex });
324322
// append the class name the classes of the item
325323
// do it on the item?
326324
// a seperate state?

0 commit comments

Comments
 (0)