diff --git a/src/index.ts b/src/index.ts index 2fe97ca..e39c830 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,7 @@ export * from './common'; export * from './divider'; export * from './dropdown'; export * from './grid'; +export * from './hooks'; export * from './image'; export * from './input'; export * from './input-number'; diff --git a/src/tabs/tabs.tsx b/src/tabs/tabs.tsx index 54d98e6..087af58 100644 --- a/src/tabs/tabs.tsx +++ b/src/tabs/tabs.tsx @@ -41,14 +41,7 @@ export default class Tabs extends Component { targetClassNameRegExpStr = `^${this.tabClasses.tdTabsClassPrefix}(__nav-item|__nav-item-wrapper|__nav-item-text-wrapper)`; - dragSorter = new UseDragSorter({ - ...this.props, - sortOnDraggable: this.props.dragSort, - onDragOverCheck: { - x: true, - targetClassNameRegExp: new RegExp(this.targetClassNameRegExpStr), - }, - }); + dragSorter: UseDragSorter | null = null; memoChildren = () => { const { list, children } = this.props; @@ -102,7 +95,7 @@ export default class Tabs extends Component { > { this.props.defaultValue === undefined && Array.isArray(this.itemList) && this.itemList.length !== 0 ? this.itemList[0].value : this.props.defaultValue; - } - - render(props: TabsProps) { - const { className, style } = props; this.dragSorter = new UseDragSorter({ ...this.props, @@ -131,6 +120,10 @@ export default class Tabs extends Component { targetClassNameRegExp: new RegExp(this.targetClassNameRegExpStr), }, }); + } + + render(props: TabsProps) { + const { className, style } = props; return (