react-carousel
react-carousel copied to clipboard
TypeError: e.resolve is not a function
Describe the bug A clear and concise description of what the bug is.
- I was trying to use two plugins
arrowsPlugin
andslidesToShowPlugin
To Reproduce Steps to reproduce the behavior:
- Go to https://brainhubeu.github.io/react-carousel/docs/examples/customArrows#custom-arrows
- Add
slidesToShowPlugin
in the resolve. In my case I did it like[arrowsPlugin, slidesToShowPlugin]
- See error
Expected behavior A clear and concise description of what you expected to happen.
- custom arrow options and numberOfSlides should be configurable
Update*
When did it like this : resolve: arrowsPlugin, slidesToShowPlugin
only arrows plugin works but the slidesToShowPlugin is not working.
Screenshots
If applicable, add screenshots to help explain your problem.
You can use multiple plugins like this
<Carousel
plugins={[
{
resolve: slidesToShowPlugin,
options: {
numberOfSlides: 6,
},
},
{
resolve: arrowsPlugin,
options: {
arrowLeft: (
<button>
<Icon name="angle-double-left" />
</button>
),
arrowLeftDisabled: (
<button>
<Icon name="angle-left" />
</button>
),
arrowRight: (
<button>
<Icon name="angle-double-right" />
</button>
),
arrowRightDisabled: (
<button>
<Icon name="angle-right" />
</button>
),
addArrowClickHandler: true,
},
},
]}
>
........
</Carousel>
@fmsthird were you able to solve this issue ?
I am having the same issue when using slidesToShowPlugin
.
TypeError: t.resolve is not a function
below is my code -
const Carousel = dynamic(import('@brainhubeu/react-carousel'), {
ssr: false,
});
const slidesToShowPlugin = dynamic(
() => {
import('@brainhubeu/react-carousel').then((module) => {
return module.slidesToShowPlugin;
});
},
{ ssr: false },
);
const slidesToScrollPlugin = dynamic(
() => {
import('@brainhubeu/react-carousel').then((module) => {
return module.slidesToScrollPlugin;
});
},
{ ssr: false },
);
```
<div className="carousel1">
<Carousel
plugins={[
{
resolve: slidesToShowPlugin,
options: {
numberOfSlides: 2,
},
},
]}>
// content here
</Carousel>
</div>