-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Button: Remove unnecessary 'useCallback' #45584
Conversation
|
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.
Makes sense
Size Change: -17 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
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.
Nice! Looks good and still tests well 🚀
What?
PR inlines the
onSetLinkRel
callback and removes unnecessaryuseCallback
hook usage.Why?
The
TextControl
isn't memoized component and will re-render whenever its parent re-renders. We don't need to pass a referentially stable callback to it.Testing Instructions
Confirm you can update Button's rel attribute as before.