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] Replace forwardRef with a shim for forward compatibility #15955

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

lauri865
Copy link
Contributor

Fixes #15770

The shim asserts that Ref is always part of the render function props (even if that is not the case in older versions), this is to force typescript to warn us in case we're accidentally spreading over the ref. Refactored everything to have ref as the last prop as a result:
Screenshot 2024-12-20 at 10 47 52

Ref warning doesn't work with slotProps though currently, as they take a slice of the props without the ref. But that can be improved as well I suppose to avoid any footguns.

@mui-bot
Copy link

mui-bot commented Dec 20, 2024

Deploy preview: https://deploy-preview-15955--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 6c788e6

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Dec 20, 2024
@lauri865
Copy link
Contributor Author

lauri865 commented Dec 20, 2024

I'm not exactly sure why docs:api started failing, but the culprit is GridToolbarDensitySelector component.

@arminmeh arminmeh requested a review from romgrk December 20, 2024 19:26
@arminmeh arminmeh changed the title [data grid] Replace forwardRef with a shim for forward compatibility [DataGrid] Replace forwardRef with a shim for forward compatibility Dec 20, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 20, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
4 participants