From 25940e46d08d9114c8e4076cf1f9e644e1e59189 Mon Sep 17 00:00:00 2001 From: Adrien Denat Date: Sat, 25 Feb 2023 19:00:23 +0000 Subject: [PATCH] fix(react): fix typings of components --- packages/react/src/SnapCarousel.tsx | 11 +++++++---- ...pCarousel.stories.jsx => SnapCarousel.stories.tsx} | 0 2 files changed, 7 insertions(+), 4 deletions(-) rename packages/react/stories/{SnapCarousel.stories.jsx => SnapCarousel.stories.tsx} (100%) diff --git a/packages/react/src/SnapCarousel.tsx b/packages/react/src/SnapCarousel.tsx index 4332310..92d0d67 100644 --- a/packages/react/src/SnapCarousel.tsx +++ b/packages/react/src/SnapCarousel.tsx @@ -78,15 +78,18 @@ export const SnapCarousel = React.forwardRef( SnapCarousel.displayName = 'SnapCarousel'; -type IndicatorProps = { +type CommonProps = { children?: React.ReactNode; className?: string; tag?: T; - index: number; activeIndex?: number; state?: State; }; +interface IndicatorProps extends CommonProps { + index: number; +} + export const SnapCarouselIndicator = React.forwardRef( ( { @@ -135,7 +138,7 @@ export const SnapCarouselNavPrev = React.forwardRef( className = '', state, ...otherProps - }: IndicatorProps, + }: CommonProps, ref?: PolymorphicRef ) => { const RootTag = tag || 'button'; @@ -178,7 +181,7 @@ export const SnapCarouselNavNext = React.forwardRef( className = '', state, ...otherProps - }: IndicatorProps, + }: CommonProps, ref?: PolymorphicRef ) => { const RootTag = tag || 'button'; diff --git a/packages/react/stories/SnapCarousel.stories.jsx b/packages/react/stories/SnapCarousel.stories.tsx similarity index 100% rename from packages/react/stories/SnapCarousel.stories.jsx rename to packages/react/stories/SnapCarousel.stories.tsx