Skip to content
Source
Sign inSign up
TanStack/table

"Cannot update a component while rendering a different component" while using controlled expanded state #6450

Send to my agent
Closedvolodymyrdn(GitHub profile, opens in a new tab) opened this issue 2 comments

TanStack Table version

9.0.0-beta.55

Framework/Library version

React v19.2.6

Describe the bug and the steps to reproduce it

Using the official Expanding example and switching to controlled expanded state, I am receiving an error saying: Cannot update a component (App) while rendering a different component (App).

To switch to the controlled state, these steps were made:

  • const [expanded, setExpanded] = useState<ExpandedState>({}) added to the App.
  • state: { expanded } uncommented.
  • onExpandedChange: setExpanded uncommented.

Here is the link to the sandbox.

Steps to reproduce the error:

  • try to expand any of rows. The error is seen in the console then.

Am I doing it wrong?

Thanks in advance.

https://codesandbox.io/p/devbox/lingering-water-s9qsyv

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not know how

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. UPDATE: this error occurs in all examples, where the controlled state is used. For example this and that.

  2. we think we finally fixed this in the latest v9 beta

  3. KevinVandy closed this

Sign in to join this conversation.