Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Missing typings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybarbet committed Feb 14, 2019
1 parent fc1017d commit 5e8e33a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 8 additions & 2 deletions overwrites/cra/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import * as React from 'react';
import { Link as RouterLink } from 'react-router-dom';

export const Link = ({ children, ...props }: any) => (
<RouterLink {...props}>
interface ILinkProps {
children: React.ReactNode;
to: string;
[key: string]: any;
}

export const Link = ({ children, to, ...props }: ILinkProps) => (
<RouterLink to={to} {...props}>
{children}
</RouterLink>
);
5 changes: 3 additions & 2 deletions overwrites/gatsby/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import * as React from 'react';
import { Link as GatsbyLink } from 'gatsby';

interface IProps {
interface ILinkProps {
children: React.ReactNode;
to: string;
[key: string]: any;
}

export const Link = ({ children, to, ...props }: IProps) => (
export const Link = ({ children, to, ...props }: ILinkProps) => (
<GatsbyLink to={to} {...props}>
{children}
</GatsbyLink>
Expand Down
7 changes: 4 additions & 3 deletions overwrites/next/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import * as React from 'react';
import NextLink from 'next/link';

interface IProps {
interface ILinkProps {
children: React.ReactNode;
to: string;
[key: string]: any;
}

export const Link = ({ children, to, ...passProps }: IProps) => (
export const Link = ({ children, to, ...props }: ILinkProps) => (
<NextLink href={to}>
<a {...passProps}>{children}</a>
<a {...props}>{children}</a>
</NextLink>
);

0 comments on commit 5e8e33a

Please sign in to comment.