-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathReactTreeView.tsx
More file actions
24 lines (21 loc) · 817 Bytes
/
Copy pathReactTreeView.tsx
File metadata and controls
24 lines (21 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { type WalkingAdapterBase } from "../tree-core";
import { MetaParserBase } from "./FlattenNodeWrapper";
import { VirtualScroller } from "../virtual-scroller";
import { ReactTreeViewProps } from "./types";
import { VirtualScrollRender } from "./VirtualScrollRender";
export const ReactTreeView = <
T extends WalkingAdapterBase,
MetaParser extends MetaParserBase<T>,
RenderOptions = {},
>(
{ containerDivProps, ...rest }: ReactTreeViewProps<T, MetaParser, RenderOptions>
) => {
return <div {...containerDivProps}>
<VirtualScroller<Omit<ReactTreeViewProps<T, MetaParser, RenderOptions>, 'containerDivProps'>>
height={rest.childCount * rest.lineHeight}
Component={VirtualScrollRender}
{...rest}
/>
</div>
}
export default ReactTreeView