MobileLink error in mobile-nav.tsx
Answered
QBit posted this in #help-forum
4 Replies
QBitOP
interface MobileLinkProps extends LinkProps {
onOpenChange?: (open: boolean) => void
children: React.ReactNode
className?: string
}
function MobileLink({
href,
onOpenChange,
className,
children,
...props
}: MobileLinkProps) {
const router = useRouter()
return (
<Link
href={href}
onClick={() => {
router.push(href.toString())
onOpenChange?.(false)
}}
className={cn(className)}
{...props}
>
{children}
</Link>
)
}
QBitOP
in
MobileLinkProps
added children?: React.ReactNode
and it fixedAnswer