Skip to content

Commit 296cc63

Browse files
committed
update replaceAll to setRootItems
1 parent 6700e78 commit 296cc63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@react-stately/data/src/useTreeData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export interface TreeData<T extends object> {
5555
* Replace the whole tree.
5656
* @param newItems - The new items to replace the tree with.
5757
*/
58-
replaceAll(newItems: T[]): void,
58+
setRootItems(newItems: T[]): void,
5959
/**
6060
* Inserts an item into a parent node as a child.
6161
* @param parentKey - The key of the parent item to insert into. `null` for the root.
@@ -262,7 +262,7 @@ export function useTreeData<T extends object>(options: TreeOptions<T>): TreeData
262262
getItem(key: Key) {
263263
return nodeMap.get(key);
264264
},
265-
replaceAll(newItems: T[]) {
265+
setRootItems(newItems: T[]) {
266266
setItems(buildTree(newItems, new Map()));
267267
},
268268
insert(parentKey: Key | null, index: number, ...values: T[]) {

0 commit comments

Comments
 (0)