src / Demo.tsx
import type { ReactElement } from "react";
import Link from "./Link";
import { useRouter } from "next/router";
export default function Demo(): ReactElement {
const { asPath } = useRouter();
const prefix = asPath.replace(/#.*$/, "");
return (
<ul>
<li>
<Link href={`${prefix}#with-icons`}>With Icons demo link</Link>
</li>
</ul>
);
}