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

TypeError: e.resolve is not a function

Open fmsthird opened this issue 4 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

  • I was trying to use two plugins arrowsPlugin and slidesToShowPlugin

To Reproduce Steps to reproduce the behavior:

  1. Go to https://brainhubeu.github.io/react-carousel/docs/examples/customArrows#custom-arrows
  2. Add slidesToShowPlugin in the resolve. In my case I did it like [arrowsPlugin, slidesToShowPlugin]
  3. 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. image

fmsthird avatar Feb 03 '21 04:02 fmsthird

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>

rheng001 avatar Apr 28 '21 20:04 rheng001

@fmsthird were you able to solve this issue ?

rikinshah23 avatar Jan 25 '22 06:01 rikinshah23

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>

rikinshah23 avatar Jan 25 '22 06:01 rikinshah23