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

Commit

Permalink
fix: tsc issue with react-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuel Suriano committed Sep 27, 2021
1 parent 12c5672 commit ae66b7b
Show file tree
Hide file tree
Showing 2 changed files with 464 additions and 30 deletions.
12 changes: 4 additions & 8 deletions gatsby-theme-mate/src/components/MarkdownComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from 'react';
import { Text } from 'rebass';
import ReactMarkdown from 'react-markdown';
import styled, { css } from 'styled-components';
import { Components } from 'react-markdown';
import styled from 'styled-components';

const StyledLink = styled.a`
display: inline-block;
Expand Down Expand Up @@ -34,7 +34,7 @@ const StyledLink = styled.a`
}
`;

const MarkdownParagraph = styled(Text)`
const MarkdownParagraph: React.FC = styled(Text)`
padding-bottom: 1em;
font-size: large;
line-height: 2em;
Expand Down Expand Up @@ -78,11 +78,7 @@ const MarkdownLink = ({ href, children }: LinkProps) => {
);
};

type MarkdownComponents = React.ComponentProps<
typeof ReactMarkdown
>['components'];

const Components: MarkdownComponents = {
const Components: Components = {
p: MarkdownParagraph,
ul: MarkdownList,
li: MarkdownListItem,
Expand Down
Loading

0 comments on commit ae66b7b

Please sign in to comment.