Skip to content

Commit

Permalink
Fix Tree virtualization example (#2394)
Browse files Browse the repository at this point in the history
  • Loading branch information
r100-stack authored Jan 8, 2025
1 parent 50e0822 commit 1c6866c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 62 deletions.
4 changes: 2 additions & 2 deletions apps/website/src/content/docs/tree.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The `getNode` function then needs to map the user `data` to a `NodeData`. The pr
const getNode = React.useCallback(
(node) => {
return {
/**/
/**/
subNodes: node.subItems,
hasSubNodes: node.subItems.length > 0,
};
Expand Down Expand Up @@ -93,7 +93,7 @@ The `isExpanded` flag which indicates whether the node is expanded to display it
const getNode = React.useCallback(
(node) => {
return {
/**/
/**/
isExpanded: expandedNodes[node.id],
};
},
Expand Down
3 changes: 1 addition & 2 deletions examples/Tree.virtualization.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.demo-tree {
width: min(100%, 260px);
height: 100%;
width: 260px;
overflow: auto;
}
1 change: 1 addition & 0 deletions examples/Tree.virtualization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default () => {
return (
<Tree
className='demo-tree'
style={{ height: '400px' }}
data={data}
getNode={getNode}
enableVirtualization
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@types/node": "*",
"@types/react": "^18",
"@types/react-dom": "^18",
"next": "^14.2.13",
"next": "^14.2.21",
"react": "^18",
"react-dom": "^18",
"typescript": "5"
Expand Down
107 changes: 50 additions & 57 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1c6866c

Please sign in to comment.