question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`CarouselProps` plugins v2 not working with a typescript project

See original GitHub issue

Describe the bug I’ve add the react-carousel and the @types package to my typescript project.

I’ve implemented the carousel as follows:

import React, { FC } from "react";
import Carousel, { autoplayPlugin } from "@brainhubeu/react-carousel";
import "@brainhubeu/react-carousel/lib/style.css";

export const CarouselComponent: FC = () => {
  return (
    <div>
      <Carousel
        plugins={[
          "infinite",
          "arrows",
          {
            resolve: autoplayPlugin,
            options: {
              interval: 2000,
            },
          },
        ]}
        animationSpeed={1000}
        draggable={false}
      >
        <div>
          <h1>Section 1</h1>
        </div>
        <div>
          <h1>Section 2</h1>
        </div>
        <div>
          <h1>Section 3</h1>
        </div>
      </Carousel>
    </div>
  );
};

However none of the props seem to be applied. For reference, the draggable prop works as intended. Am I missing something?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
adieselcommented, Oct 30, 2020

We have the same problem. We switched to v 1.19.26 to use the arrows =/

0reactions
Amhekleriorcommented, Jan 29, 2021

I’ve had the same issue using v2 of the library in a react/typescript project.

I solved the issue downgrading react and react-dom versions to match the peer dependencies of the library: 16.8.0.

I put more details here: https://github.com/brainhubeu/react-carousel/issues/637#issuecomment-769775003

Read more comments on GitHub >

github_iconTop Results From Across the Web

`CarouselProps` plugins v2 not working with a typescript project #656
Describe the bug I've add the react-carousel and the @types package to my typescript project. I've implemented the carousel as follows:
Read more >
Breakpoints not working due typescript Interface #649 - GitHub
Hi, I' am trying to use this lib in a typescript application. When i try to define the breakpoints, it fails to transpile...
Read more >
How to set up TypeScript
To do this, run npm install -g typescript . This will install the latest version (currently 4.9).
Read more >
js carousel example
The plugin contains different types of sliders such as slider with ... Start using react-responsive-carousel in your project by running `npm i Check...
Read more >
TypeScript | CLion Documentation - JetBrains
Verify TypeScript in the entire project. To open the Problems tool window, click the Inspections widget in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found