Skip to content

Commit

Permalink
fix(TreeList): add ListTreeItemType interface export and id argument …
Browse files Browse the repository at this point in the history
…to renderItem prop
  • Loading branch information
IsaevAlexandr committed Jul 15, 2024
1 parent 07a16c9 commit c255987
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/TreeList/TreeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const TreeList = <T,>({

if (propsRenderItem) {
return propsRenderItem({
id: itemId,
data: renderState.data,
props: renderState.props,
context: renderState.context,
Expand Down
1 change: 1 addition & 0 deletions src/components/TreeList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {
} from '../useList';

export type TreeListRenderItem<T, P extends {} = {}> = (props: {
id: ListItemId;
data: T;
// required item props to render
props: RenderItemProps;
Expand Down
1 change: 1 addition & 0 deletions src/unstable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export {
ListContainer as unstable_ListContainer,
type ListContainerViewProps as unstable_ListContainerViewProps,
type ListItemType as unstable_ListItemType,
type ListTreeItemType as unstable_ListTreeItemType,
type ListItemId as unstable_ListItemId,
type UseListResult as unstable_UseListResult,
getItemRenderState as unstable_getItemRenderState,
Expand Down

0 comments on commit c255987

Please sign in to comment.