Skip to content

Commit

Permalink
Update typescript.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
ScreamZ authored May 2, 2024
1 parent 9132c84 commit bbb3655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/pages/docs/workflows/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ Using next-intl you can achieve similar behavior this way:
// For the same of the exemple, this is created here but in a real app, this lives in another file.
const { Link, redirect, usePathname, useRouter, getPathname } = createLocalizedPathnamesNavigation({ locales, localePrefix, pathnames });

type NavLinkProps<T extends string> = {
type NavLinkProps = {
href: ComponentProps<typeof Link>["href"]; // Here is the magic
title: string;
icon?: React.ReactNode;
};

function NavLink<T extends string>({ href, icon, title }: NavLinkProps<T>) {
function NavLink<T extends string>({ href, icon, title }: NavLinkProps) {
return (
<Link
href={href}
Expand Down

0 comments on commit bbb3655

Please sign in to comment.