We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a881454 commit 13c7e7bCopy full SHA for 13c7e7b
src/components/collapse/collapse-group.tsx
@@ -48,11 +48,11 @@ const CollapseGroupComponent: React.FC<React.PropsWithChildren<CollapseGroupProp
48
setState([]);
49
}
50
} else {
51
- const currentIndexExists = state.includes(currentIndex);
+ const currentIndexExists = stateRef.current.includes(currentIndex);
52
if (nextState && !currentIndexExists) {
53
- setState([...state, currentIndex]);
+ setState([...stateRef.current, currentIndex]);
54
} else if (!nextState && currentIndexExists) {
55
- setState(state.filter(item => item !== currentIndex));
+ setState(stateRef.current.filter(item => item !== currentIndex));
56
57
58
};
0 commit comments