Skip to content

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

Closed
@Greggics

Description

@Greggics

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions