docs: update active link code snippet for better equality check (#53327)
Update pathname and href matching check from startsWith() method to strict equality. startsWith() method causes all paths to match with root link "/"
This commit is contained in:
parent
d3b0c7bb42
commit
97a0a3373f
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ export function Navigation({ navLinks }) {
|
|||
return (
|
||||
<>
|
||||
{navLinks.map((link) => {
|
||||
const isActive = pathname.startsWith(link.href)
|
||||
const isActive = pathname === link.href
|
||||
|
||||
return (
|
||||
<Link
|
||||
|
|
Loading…
Reference in a new issue