From 7515b904e729207236040c9d3624147a59d89f49 Mon Sep 17 00:00:00 2001 From: riiniii Date: Fri, 15 Jan 2021 20:36:29 +0800 Subject: [PATCH] feat: fix typescript typing, and add in an import fix #664 --- src/components/Layout/Column.tsx | 2 +- src/components/Layout/Container.tsx | 2 +- src/components/Layout/Row.tsx | 5 +++-- stories/typography.stories.tsx | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Layout/Column.tsx b/src/components/Layout/Column.tsx index 8169e817..6b5df531 100644 --- a/src/components/Layout/Column.tsx +++ b/src/components/Layout/Column.tsx @@ -6,7 +6,7 @@ interface Props { * HTML element to be used for the component * @default
*/ - as?: React.ElementType + as?: keyof JSX.IntrinsicElements /** * The number of columns to span on extra large devices (≥ 1200px) */ diff --git a/src/components/Layout/Container.tsx b/src/components/Layout/Container.tsx index b8a2237a..f9c9e09c 100644 --- a/src/components/Layout/Container.tsx +++ b/src/components/Layout/Container.tsx @@ -6,7 +6,7 @@ interface Props { * A custom element to be used for the component * @default
*/ - as?: React.ElementType + as?: keyof JSX.IntrinsicElements // As extends React.ElementType // '"symbol" | undefined' /** * Allow the Container to fill all of its available horizontal space * @default false diff --git a/src/components/Layout/Row.tsx b/src/components/Layout/Row.tsx index 386e8eb4..d30db668 100644 --- a/src/components/Layout/Row.tsx +++ b/src/components/Layout/Row.tsx @@ -1,4 +1,5 @@ -import React, { CSSProperties } from 'react' +import { CSSProperties } from 'react' +import * as React from 'react' import BootstrapRow from 'react-bootstrap/Row' interface Props { @@ -6,7 +7,7 @@ interface Props { * HTML element to be used for the component * @default
*/ - as?: React.ElementType + as?: keyof JSX.IntrinsicElements // React.ElementType /** * Removes the gutter spacing between `Columns` as well as any added negative margins. * @default false diff --git a/stories/typography.stories.tsx b/stories/typography.stories.tsx index 452fab3c..2db10d52 100644 --- a/stories/typography.stories.tsx +++ b/stories/typography.stories.tsx @@ -1,4 +1,5 @@ import { storiesOf } from '@storybook/react' +import * as React from 'react' import { Typography } from '../src'