React: isExpanded state changes on all rows when header button is clicked causing lag (v7) #4822
Unanswered
stephanie-saretsky
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! Trying to figure out an issue with my table that uses expandable rows that happens when the user clicks a back button that uses next/router's
router.back()
.I have different row colours depending if the row is expanded or not. When the user clicks the back button that is within the header, all of the rows change colour and there is about a 1-2 second lag before the page navigates away. I checked my logs and this is because the
row.isExpanded
prop for every row changes fromundefined
totrue
on button click. Is there a way to prevent this behaviour? I tried withe.preventDefault()
on button click before calling the router but no dice. I have buttons in cells and those operate as expected, it's just the buttons in the header causing this issue. Thanks!and button within column header:
Beta Was this translation helpful? Give feedback.
All reactions