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

facing 'Could not find a declaration file for module '3d-react-carousal'. issue

Open bdamor5 opened this issue 3 years ago • 3 comments

i tried following the solutions provided in https://stackoverflow.com/questions/41462729/typescript-react-could-not-find-a-declaration-file-for-module-react-material , but faced the same issue. Because of this , the carousel is not being displayed in my app.

bdamor5 avatar Mar 22 '22 19:03 bdamor5

add the following line at you "type.d.ts" file.

declare module "react-select-country-list";

markwarrenj81 avatar Sep 18 '22 02:09 markwarrenj81

@bdamor5 were you able to find any solution for this?

sparshsharma2510 avatar Nov 09 '22 18:11 sparshsharma2510

@sparshsharma2510 @bdamor5

I solved this problem by following these steps:

First I created a new component:

import { Carousel } from '3d-react-carousal';

export default function Carousel3() {
    let slides = [
        <img src="yourImage.jpg" alt="1" />,
        <img src="yourImage.jpg" alt="2" />];
    return (
        <Carousel slides={slides} autoplay={true} interval={1000} arrows={false} />
    )
}

Then following this answer i dynamically imported the component: https://stackoverflow.com/a/71151382

import dynamic from 'next/dynamic'

const Carousel = dynamic(
  () => import('../components/Carousel/index'),
  { ssr: false }
)

...
export default function Home() {
  return (
       <Carousel />
  )

}

hantonny avatar Mar 17 '23 20:03 hantonny