T
TanStack2y ago
exotic-emerald

isAllRowsExpanded - how to make that work with managing expanded state?

My issue is i want grouping to auto expand. There is a clear flicker when i use this mechanic to do so:
useLayoutEffect(() => {
if (grouping.length > 0) {
toggleAllRowsExpanded(true);
}
}, [grouping, toggleAllRowsExpanded]);
useLayoutEffect(() => {
if (grouping.length > 0) {
toggleAllRowsExpanded(true);
}
}, [grouping, toggleAllRowsExpanded]);
So, i figured I'd switch to managing my own expanded state by passing props, expanded and onExpandedChange. However, the state isAllRowsExpanded is not reflecting the correct value in this method. when i collapse / expand all rows manually, its not getting updated per my desire/expectation. How can i solve both of these problems? If there are better suggestions for the initial problem of auto expanding rows without managing your own expanded state, let me know.
2 Replies
exotic-emerald
exotic-emeraldOP2y ago
GitHub
Expand groups by default · Issue #2404 · TanStack/table
Hi @tannerlinsley, react-table is great! I have been using it in various projects. On one of my projects I have a initialstate.groupby and no ability to ungroup. I would however like to have the ro...
exotic-emerald
exotic-emeraldOP2y ago
my apologies coming from using react table v7

Did you find this page helpful?