Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion modules/react-arborist/src/components/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ export function TreeProvider<T>({
useMemo(() => {
updateCount.current += 1;
api.update(treeProps);
}, [...Object.values(treeProps), state.nodes.open]);
}, [...Object.values(treeProps)]);

/* Rebuild visible nodes when open state changes, without clobbering
props set imperatively via api.update(). Bumping updateCount keeps
DataUpdates consumers (e.g. DefaultContainer) in sync. */
useMemo(() => {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — you nailed it. CI surfaced the same regression and the amended commit (33e6de2) now bumps updateCount.current in the open-state memo as you suggested. Verified locally with the gmail-spec e2e (12/12 passing).

updateCount.current += 1;
api.update(api.props);
}, [state.nodes.open]);

/* Expose the tree api */
useImperativeHandle(imperativeHandle, () => api);
Expand Down
Loading