-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
shadcn React 19 #1243
base: main
Are you sure you want to change the base?
shadcn React 19 #1243
Conversation
This should merge after #1233 |
they don't include ref as prop yet
); | ||
}, | ||
); | ||
Button.displayName = "Button"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I'm curious as to why we don't need displayName anymore. (tbh I don't know the purpose of it in the first place) do you have any resources to share about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand it's cause the component function inside the forwardRef previously was an anonymous function. you could have done forwardRef(function Button(...))
and have the displayName inferred before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Same goes for memo()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(tbh I don't know the purpose of it in the first place)
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
DisplayName allows you to name your component. This name is used by React in debugging messages.
Update shadcn components to use React 19 (removed forwardRefs) and clean up.