Skip to content

Conversation

@aarongarciah
Copy link
Member

@aarongarciah aarongarciah commented Aug 13, 2024

@aarongarciah aarongarciah added test package: utils Specific to the 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 integration: react About improving React support. label Aug 13, 2024
@aarongarciah aarongarciah merged commit 224756b into next Aug 13, 2024
@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

integration: react About improving React support. package: utils Specific to the utils package. test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants