-
-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
Is your feature request related to a problem? Please describe.
I've been creating a solution to #263 for my own usage and I managed to get something that works pretty well using a few custom renderers, however I have had to reach into the lib directory and import TreeItem
.
import { TreeItem } from 'react-complex-tree/lib/cjs/treeItem/TreeItem'
This isn't a huge issue, however I have had to also update all my other imports to use 'react-complex-tree/lib/cjs'
since NextJS/Webpack switches between the CJS and ESM versions depending on client/server builds so React context gets lost.
Describe the solution you'd like
Expose TreeItem
or useTreeItemRenderContext
to the main package. If they are still "unstable", maybe expose them under a __UNSTABLE
constant?
// src/index.ts
import { useTreeItemRenderContext } from './treeItem/useTreeItemRenderContext';
import { TreeItem } from './treeItem/TreeItem';
export * from './controlledEnvironment/ControlledTreeEnvironment';
export * from './tree/Tree';
export * from './uncontrolledEnvironment/UncontrolledTreeEnvironment';
export * from './uncontrolledEnvironment/StaticTreeDataProvider';
export * from './types';
export * from './renderers';
export const __UNSTABLE = {
useTreeItemRenderContext,
TreeItem,
};
Describe alternatives you've considered
- Import directly from
'react-complex-tree/lib/cjs'
Additional context
JackCuthbert and ben-cook
Metadata
Metadata
Assignees
Labels
No labels