After creating a menu with the Link
component in NextJs using href=#contact
, I encountered an issue. When I use querySelector on this a
element, the href
unexpectedly changes to http://localhost:3000/#contact'
, preventing me from scrolling to that section. Why is this happening and how can I ensure that only #contact
remains as the href
?