"onMouseEnter" was passed to <Link> with `href` of `/` but "legacyBehavior" was set
See original GitHub issueDescription
Passing a NextJs Link to Charka Link results in legacyBehaviour set
Link to Reproduction
None
Steps to reproduce
- Write Code
<NextLink href={navItem.href ?? "#"} passHref>
<Link
p={2}
fontSize={"sm"}
fontWeight={500}
color={linkColor}
_hover={{
textDecoration: "none",
color: linkHoverColor,
}}
>
{navItem.label}
</Link>
</NextLink>;
Chakra UI Version
2.0.0
Browser
Chrome/100.0.4896.127
Operating System
- macOS
- Windows
- Linux
Additional Information
Passing legacyBehavior
prop does not solve this issue
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
ERROR "onMouseEnter" was passed to <Link> with `href`
I got an error. "onMouseEnter" was passed to with `href` of `/FAQ` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter ...
Read more >How to overcome warning of "onClick" was passed to <Link ...
"onClick" was passed to with href of /discovery/edit but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child ......
Read more >next - NPM Package Compare versions - Socket.dev
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter ...
Read more >onmouseenter Event - W3Schools
The onmouseenter event occurs when the mouse pointer enters an element. The onmouseenter event is often used together with the onmouseleave event, ...
Read more >一文搞懂最强首屏渲染方案【Next.js】
`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve managed to resolve the issue. It due to the props not being passed. I created a custom component like below
@henrychea could you give more info on the exact issue you have now. Feel free to reopen with a minimal reproduction.