Skip to content

Commit

Permalink
fix(@clayui/core): fixes error when cleaning up the collection for ex…
Browse files Browse the repository at this point in the history
…plicitly nested collections

The clean up should only be done in use cases where we have the collection implicitly declared as the VerticalNav component and the list is rendered in render time instead of just once in the root of the component like the Picker component.
  • Loading branch information
matuzalemsteles committed Nov 1, 2023
1 parent 0463820 commit e0714d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/clay-core/src/collection/useCollection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ export function useCollection<
// there are nested collections.
useEffect(
() => () => {
cleanUp();

if (forceUpdate) {
cleanUp();

forceUpdate(null);
}
},
Expand Down

0 comments on commit e0714d1

Please sign in to comment.