Skip to content
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

[DataGrid] Removes <GridCell /> fallback to valueToRender on null children #7023

Merged
merged 3 commits into from
Dec 1, 2022

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Nov 28, 2022

Closes #5612

  • Fix the issue
  • Test the fix
  • Fix other impacting tests

Changelog

Breaking changes

  • Passing children as null to <GridCell /> will not render valueToRender anymore

@MBilalShafi MBilalShafi added breaking change component: data grid This is the name of the generic UI component, not the React module! v6.x dx Related to developers' experience labels Nov 28, 2022
@MBilalShafi MBilalShafi self-assigned this Nov 28, 2022
@mui-bot
Copy link

mui-bot commented Nov 28, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-7023--material-ui-x.netlify.app/

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 691.1 1,227.9 691.1 937.58 193.502
Sort 100k rows ms 660.3 1,253.1 1,253.1 959.08 213.493
Select 100k rows ms 215.5 326.2 276.8 282.6 39.25
Deselect 100k rows ms 199.5 278.3 219.7 225.78 27.463

Generated by 🚫 dangerJS against 3d15535

@MBilalShafi MBilalShafi marked this pull request as ready for review November 28, 2022 11:29
@MBilalShafi
Copy link
Member Author

MBilalShafi commented Nov 28, 2022

@mui/x Team, I am not sure if this should be added to the migration guide, I mean could there be any possibility someone is returning null to have valueToRender shown?

@MBilalShafi MBilalShafi merged commit e44222a into mui:next Dec 1, 2022
@MBilalShafi MBilalShafi deleted the allows-null-grid-cell branch December 1, 2022 06:21
@cherniavskii
Copy link
Member

could there be any possibility someone is returning null to have valueToRender shown?

I can think of only one use case - returning the custom component conditionally and falling back to the default one:

const renderCell = () => {
  if (condition) {
    return <CustomComponent />;
  }
  return null;
}

I think it's worth mentioning in the migration guide with a suggestion to return undefined instead to keep the same behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: data grid This is the name of the generic UI component, not the React module! dx Related to developers' experience v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Do not fallback on valueToRender when children === null
4 participants