import React, { forwardRef } from "react"; import cn from "classnames"; import { AsComponent, AsPropsWithChildren } from "../utils/asComponent"; export interface INavLinkProps extends AsPropsWithChildren, React.HTMLAttributes { isActive?: boolean; isDisabled?: boolean; onClick?: (event: React.SyntheticEvent) => void; eventKey?: string; } type NavLink = AsComponent<"a", INavLinkProps>; const NavLink: NavLink = forwardRef( ({ isActive, isDisabled, className, onClick, children, as: Component = "a", ...props }, ref) => { return ( {children} ); } ); NavLink.displayName = "NavLink"; export default NavLink;