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

Bug in importing {consts} in typescript

Open Kartik-989 opened this issue 2 years ago • 3 comments

Describe the bug

import {consts} from 'react-elastic-carousel'; This is not working in typescript files. I have file with .js then imoprt is working and in .tsx it gives error

Error is: Module '"react-elastic-carousel"' has no exported member 'consts'. Did you mean to use 'import consts from "react-elastic-carousel"' instead?

Sandbox link Please provide a link to a codesandbox with the reproduced bug

Screenshots If applicable, add screenshots to help explain your problem. https://codesandbox.io/s/awesome-stitch-760o29?file=/src/App.tsx

Kartik-989 avatar Jun 14 '22 13:06 Kartik-989

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 Aug 13 '22 02:08 itseasy21

@itseasy21 Hi, I installed your forked version 0.12.2 to my project and found a bug. When I want to swipe to the right, everything swipes to the left firstly and also otherwise. Could you please fix this ?:) Adding working sandbox with v0.12.2: https://codesandbox.io/s/react-elastic-carousel-forked-fcr8x0?file=/src/index.js&resolutionWidth=320&resolutionHeight=675

MiroKopecky avatar Aug 29 '22 14:08 MiroKopecky

@itseasy21 Hi, I installed your forked version 0.12.2 to my project and found a bug. When I want to swipe to the right, everything swipes to the left firstly and also otherwise. Could you please fix this ?:) Adding working sandbox with v0.12.2: https://codesandbox.io/s/react-elastic-carousel-forked-fcr8x0?file=/src/index.js&resolutionWidth=320&resolutionHeight=675

MiroKopecky avatar Sep 12 '22 12:09 MiroKopecky

@MiroKopecky apologies missed the issue over here. Maybe try to set enableSwipe on breakpoint with width 1 and see if that fixes the issue?

const breakPoints = [
  { width: 1, itemsToShow: 1, enableSwipe: true },
  { width: 408, itemsToShow: 3, itemsToScroll: 0 }
];

Also, if you have another fix, happy to take a PR on https://github.com/itseasy21/react-elastic-carousel

itseasy21 avatar Sep 21 '22 02:09 itseasy21

@itseasy21 thanks for the answer but unfortunately that didnt help. What's odd is that is works on older versions just fine (in sandbox; in my project I receive different error (some react swipeable) so I thought it would be easier to fix this package). I havent figured it out myself neither:/

MiroKopecky avatar Sep 21 '22 07:09 MiroKopecky

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 Nov 22 '22 20:11 stale[bot]