Skip to content

[data grid] Following 7.19.0 release setting a column definition prop to undefined doesn't reset the prop when type is set #15317

@iemi111

Description

@iemi111

Steps to reproduce

Link to live example: (required)

Steps:

  1. Set one of the column definition's render props (e.g. renderCell) to a dynamic value (based on another state)
  2. Set the type of the column definition
  3. Trigger a change to the value of the render prop in Step 1

https://stackblitz.com/edit/github-3rk5go-nd8osk?file=src%2Fdemo.tsx

Current behavior

The Grid state doesn't reset to its default when the "render" prop is set back to undefined when the "type" of the column is specified but it does when the "type" is not set.

Expected behavior

If one of the props in the column definition object is updated to undefined after previously being set, then the MUI default for that prop should be used even when the type of the column definition is set.

Context

It stopped working following the 7.19.0 release. After some investigation I found it broke after #14456 was merged.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: undefined, column definition
Order ID: 91184

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: data gridChanges related to the data grid.support: pro standardSupport request from a Pro standard plan user. https://mui.com/legal/technical-support-sla.type: regressionA bug, but worse, it used to behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions