Skip to content

[AnalyticalTable > Subcomponents]: VirtualTableBody tries to update AnalyticalTable during its render #6755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
Greggics opened this issue Dec 17, 2024 · 3 comments · May be fixed by #7366
Open
1 task done

Comments

@Greggics
Copy link

Describe the bug

On AnalyticalTable components with the renderRowSubComponent prop set, and the subComponentsBehavior prop set to "IncludeHeightExpandable" I get the following error message when I collapse a table row for the first time:

Cannot update a component (`AnalyticalTable`) while rendering a different component (`VirtualTableBody`). To locate the bad setState() call inside `VirtualTableBody`, follow the stack trace as described in https://react.dev/link/setstate-in-render

Note: This only happens the very first time you collapse a row since the last page load. Not even unmounting and remounting seems to trigger this error again. You have to refresh the page for the this error to occur again.

I also tried it with multiple AnalyticalTable components. The error seems to trigger the first time any of the tables rows is getting collapsed. It won't trigger on the other table anymore at that point.

Isolated Example

https://stackblitz.com/edit/github-ccdfvjhn?file=src%2FApp.tsx

Reproduction steps

  1. Open the example
  2. Open the Browser Development Tools
  3. Expand any of the rows
  4. Collapse a row of your choice
  5. Get error message in the console saying "Cannot update a component (AnalyticalTable) while rendering a different component (VirtualTableBody). To locate the bad setState() call inside VirtualTableBody, follow the stack trace as described in https://react.dev/link/setstate-in-render"
  6. The error will not occur anymore. Refresh the page and start again from (3.) to re-trigger the error.

Expected Behaviour

No response

Screenshots or Videos

No response

UI5 Web Components for React Version

2.5.0

UI5 Web Components Version

2.5.0

Browser

Chrome, Edge, Firefox

Operating System

No response

Additional Context

No response

Relevant log output

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
@Logudaf
Copy link

Logudaf commented May 2, 2025

Hello,
Is there any temporary fix for this issue?
Thank you.

@pop1989bb
Copy link

@Lukas742 Do you have an idea when this issue will be researched?

@Lukas742
Copy link
Contributor

Hi all,

while the error is of course unintended, it doesn’t appear to break the implementation, which is why we initially treated this issue with low priority. However, if the component or application is crashing for you, or if you're experiencing any other unexpected behavior, please let us know.

That said, I’ll try to prioritize the issue more. I’ve already taken a quick look at the root cause last week, but unfortunately, it doesn’t seem easy to resolve and will likely require significant refactoring effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
4 participants