You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a Link component polymorphically as a button with only an href (<Button as={Link} href="/">), the app will produce a warning that says [Next UI] [useLink]: onClick is deprecated, please use onPress instead. This happens even when an onClick handler has not been provided directly on the button. Presumably the Button is using the Link's onClick handler internally.
I saw some previous bugs where this was already fixed (#3196, for example), but in that case, an onPress handler was being provided. In this case, I'm only providing an href.
You can see in the source code for App.tsx that the onClick handler is not being used.
Expected behavior
The button still works as usual, presumably using the internal onClick handler. I would expect it to use the internal onPress handler instead, and to not print the warning.
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
The text was updated successfully, but these errors were encountered:
NextUI Version
2.6.10
Describe the bug
When using a Link component polymorphically as a button with only an href (
<Button as={Link} href="/">
), the app will produce a warning that says[Next UI] [useLink]: onClick is deprecated, please use onPress instead.
This happens even when an onClick handler has not been provided directly on the button. Presumably the Button is using the Link's onClick handler internally.I saw some previous bugs where this was already fixed (#3196, for example), but in that case, an onPress handler was being provided. In this case, I'm only providing an href.
Your Example Website or App
https://codesandbox.io/p/sandbox/next-ui-button-as-link-reproduction-zn6jc7
Steps to Reproduce the Bug or Issue
Expected behavior
The button still works as usual, presumably using the internal onClick handler. I would expect it to use the internal onPress handler instead, and to not print the warning.
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
The text was updated successfully, but these errors were encountered: