Skip to content

[data grid] React 19 - everything that depends on GridRootPropsContext re-renders on every state change (or root re-render) if the ref prop is present #15770

@lauri865

Description

@lauri865

Search keywords

N/A

Latest version

  • I have tested the latest version

Affected products

Data Grid

Steps to reproduce

Steps:

  1. Generic – [React 19] ForwardRef props are not referentially stable, breaking downstream memoizations facebook/react#31613
  2. Datagrid specific – [DataGrid] Improve resize performance #15549 (comment)

Current behavior

Read more about on the links above.

Found in the midst of another PR, so opening an issue so it doesn't go overlooked, especially now that there's official React 19 support and React 19 is stable.

Worth noting that it can also affect instances where developers don't actually provide a ref, but have created an abstracted component over the Datagrid which passes forward the ref prop by explicitly naming it as ref={ref} even if ref={undefined}. This was the case for us. Which means that the potential share of users affected is much wider.

Not sure if the problem affects any other areas of the DataGrid as well, but probably not as critical as this.

cc @arminmeh, since you worked on the React 19 support

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: data gridChanges related to the data grid.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions