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

[utils][test] Remove unnecessary ref param #43282

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

aarongarciah
Copy link
Member

@aarongarciah aarongarciah commented Aug 13, 2024

@aarongarciah aarongarciah added test package: utils Specific to the @mui/utils package labels Aug 13, 2024
Comment on lines -44 to +50
const AnonymousMemoComponent = React.memo((props, ref) => <div {...props} ref={ref} />);
const AnonymousMemoComponent = React.memo((props) => <div {...props} />);

const MemoComponent = React.memo(function Div(props, ref) {
return <div {...props} ref={ref} />;
const MemoComponent = React.memo(function Div(props) {
return <div {...props} />;
});

const NamedMemoComponent = React.memo((props, ref) => <div {...props} ref={ref} />);
const NamedMemoComponent = React.memo((props) => <div {...props} />);
Copy link
Member Author

@aarongarciah aarongarciah Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React 19 types complain about React.memo receiving a ref param.

Also, the ref param does nothing because the component is not using React.forwardRef, hence ref is unnecessary. It's probably there because of copy pasting.

@aarongarciah aarongarciah added the React 19 support PRs required to support React 19 label Aug 13, 2024
@aarongarciah aarongarciah merged commit 224756b into next Aug 13, 2024
28 checks passed
@aarongarciah aarongarciah deleted the remove-unused-ref-param branch August 13, 2024 14:22
@oliviertassinari
Copy link
Member

Nice small scoped PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: utils Specific to the @mui/utils package React 19 support PRs required to support React 19 test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants