Unverified Commit b280c82a authored by Henrik Wenz's avatar Henrik Wenz Committed by GitHub

[Examples] Fix active-class-name (#12931)

parent f840e1fe
......@@ -4,12 +4,12 @@ import Link from 'next/link'
import React, { Children } from 'react'
const ActiveLink = ({ children, activeClassName, ...props }) => {
const { pathname } = useRouter()
const { asPath } = useRouter()
const child = Children.only(children)
const childClassName = child.props.className || ''
const className =
pathname === props.href
asPath === props.href
? `${childClassName} ${activeClassName}`.trim()
: childClassName
......
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