Skip to content

Commit e03b0a7

Browse files
committed
Update exports.
1 parent ed3ba77 commit e03b0a7

16 files changed

+23
-25
lines changed

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ export * from './utils/tree-data-utils'
55
// for when component is used with other components using react-dnd.
66
// see: https://github.com/gaearon/react-dnd/issues/186
77

8-
export { default, SortableTreeWithoutDndContext } from './react-sortable-tree'
8+
export {
9+
SortableTree,
10+
SortableTreeWithoutDndContext,
11+
} from './react-sortable-tree'

src/react-sortable-tree.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,9 @@ ReactSortableTree.defaultProps = {
962962
overscan: 0,
963963
}
964964

965-
const SortableTreeWithoutDndContext = (props: ReactSortableTreeProps) => {
965+
export const SortableTreeWithoutDndContext = (
966+
props: ReactSortableTreeProps
967+
) => {
966968
return (
967969
<DndContext.Consumer>
968970
{({ dragDropManager }) =>
@@ -974,17 +976,10 @@ const SortableTreeWithoutDndContext = (props: ReactSortableTreeProps) => {
974976
)
975977
}
976978

977-
const SortableTree = (props: ReactSortableTreeProps) => {
979+
export const SortableTree = (props: ReactSortableTreeProps) => {
978980
return (
979981
<DndProvider debugMode={props.debugMode} backend={HTML5Backend}>
980982
<SortableTreeWithoutDndContext {...props} />
981983
</DndProvider>
982984
)
983985
}
984-
985-
// Export the tree component without the react-dnd DragDropContext,
986-
// for when component is used with other components using react-dnd.
987-
// see: https://github.com/gaearon/react-dnd/issues/186
988-
export { SortableTreeWithoutDndContext }
989-
990-
export default SortableTree

src/stories/advanced/childless-nodes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import SortableTree from '../../../src'
2+
import { SortableTree } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

src/stories/advanced/generate-node-props.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import SortableTree, { changeNodeAtPath } from '../../../src'
2+
import { SortableTree, changeNodeAtPath } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

src/stories/advanced/only-expand-searched-node.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { Component, useState } from 'react'
2-
import SortableTree from '../../../src'
1+
import React, { useState } from 'react'
2+
import { SortableTree } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

src/stories/advanced/tree-to-tree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import SortableTree from '../../../src'
2+
import { SortableTree } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

src/stories/basics/add-remove.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import SortableTree, { addNodeUnderParent, removeNodeAtPath } from '../../../src'
2+
import { SortableTree, addNodeUnderParent, removeNodeAtPath } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

src/stories/basics/barebones.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import SortableTree from '../../../src'
2+
import { SortableTree } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

src/stories/basics/callbacks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import SortableTree from '../../../src'
2+
import { SortableTree } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

src/stories/basics/can-drop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import SortableTree from '../../../src'
2+
import { SortableTree } from '../../../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

0 commit comments

Comments
 (0)