react-elastic-carousel icon indicating copy to clipboard operation
react-elastic-carousel copied to clipboard

Typescript Support

Open mufaawan opened this issue 2 years ago • 2 comments

Do we have typescript supported version on it way? I have been trying to implement with Typescript, I end up getting so many errors I am not sure how to fix.

error TS2769: No overload matches this call. Overload 1 of 2, '(props: ReactElasticCarouselProps | Readonly): ReactElasticCarousel', gave the following error. Type '{ children: Element[]; itemsToShow: number; itemsToScroll: number; isRTL: boolean; showArrows: false; outerSpacing: number; itemPadding: number[]; pagination: true; breakPoints: ({ width: number; itemsToShow: number; itemsToScroll?: undefined; } | { ...; })[]; focusOnSelect: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'. Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'. Overload 2 of 2, '(props: ReactElasticCarouselProps, context: any): ReactElasticCarousel', gave the following error. Type '{ children: Element[]; itemsToShow: number; itemsToScroll: number; isRTL: boolean; showArrows: false; outerSpacing: number; itemPadding: number[]; pagination: true; breakPoints: ({ width: number; itemsToShow: number; itemsToScroll?: undefined; } | { ...; })[]; focusOnSelect: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.

mufaawan avatar May 24 '22 16:05 mufaawan

same problem here

Cristian-ADSI avatar Jun 09 '22 16:06 Cristian-ADSI

I've forked a version of this and added TS/React 18 support: https://www.npmjs.com/package/@itseasy21/react-elastic-carousel Hopefully, this helps :-)

itseasy21 avatar Jul 12 '22 13:07 itseasy21

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 20 '22 18:09 stale[bot]