Skip to content

Commit

Permalink
[docs] Use LinkProps from next in examples (#16583)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored and eps1lon committed Jul 12, 2019
1 parent 279981f commit 22ba481
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions examples/nextjs-with-typescript/src/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
import React from 'react';
import clsx from 'clsx';
import { useRouter } from 'next/router';
import NextLink from 'next/link';
import NextLink, { LinkProps as NextLinkProps } from 'next/link';
import MuiLink, { LinkProps as MuiLinkProps } from '@material-ui/core/Link';

interface NextLinkProps {
as?: string;
href?: string;
prefetch?: boolean;
}

type NextComposedProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & NextLinkProps;

const NextComposed = React.forwardRef(function NextComposed(
Expand All @@ -26,11 +20,13 @@ const NextComposed = React.forwardRef(function NextComposed(
);
});

interface LinkProps extends MuiLinkProps, NextLinkProps {
interface LinkPropsBase {
activeClassName?: string;
naked?: boolean;
}

type LinkProps = LinkPropsBase & NextLinkProps & MuiLinkProps;

// A styled version of the Next.js Link component:
// https://nextjs.org/docs/#with-link
function RouterLink(props: LinkProps) {
Expand Down

0 comments on commit 22ba481

Please sign in to comment.