Unverified Commit 97a0a337 authored by Ozan Sevkin's avatar Ozan Sevkin Committed by GitHub

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 "/"
parent d3b0c7bb
...@@ -78,7 +78,7 @@ export function Navigation({ navLinks }) { ...@@ -78,7 +78,7 @@ export function Navigation({ navLinks }) {
return ( return (
<> <>
{navLinks.map((link) => { {navLinks.map((link) => {
const isActive = pathname.startsWith(link.href) const isActive = pathname === link.href
return ( return (
<Link <Link
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment