src / Demo.tsx
123456789101112131415import React, { 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>
);
}