Skip to content

[data grid] useResizeContainer error when getRowHeight={() => 'auto'} #17139

@PontusAxelsson

Description

@PontusAxelsson

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/react-ecztqxbj?file=Demo.tsx
  2. Click console
  3. Edit something to trigger a rerender
  4. Console is displaying error

Current behavior

When using DataGrid with getRowHeight={() => 'auto'} it cause a console error:

`MUI X: useResizeContainer - The parent DOM element of the Data Grid has an empty height.
Please make sure that this element has an intrinsic height.
The grid displays with a height of 0px.

More details: https://mui.com/r/x-data-grid-no-dimensions.`

The same error is shown on https://mui.com/x/react-data-grid/row-height/?srsltid=AfmBOooQ_3d893AapCP7zR-gxCi4zXvjLyh8CAr4U58Yip2NYOk9pf1l#dynamic-row-height

Expected behavior

When using DataGrid with getRowHeight={() => 'auto'} it should not cause a console error.

Context

The DataGrid component with getRowHeight={() => 'auto'} works as expected but still render error in console.

Your environment

npx @mui/envinfo

System:
OS: Linux 6.8 Linux Mint 21.3 (Virginia)
Binaries:
Node: 21.6.0 - ~/.nvm/versions/node/v21.6.0/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v21.6.0/bin/npm
pnpm: Not Found
Browsers:
Chrome: 134.0.6998.35

Search keywords: DataGrid getRowHeight useResizeContainer

Order ID: 61657

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: Rendering layoutRelated to the data grid Rendering enginescope: data gridChanges related to the data grid.support: premium standardSupport request from a Premium standard plan user. https://mui.com/legal/technical-support-sla.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions