davidjerleke / embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.
https://www.embla-carousel.com
MIT License
5.5k stars 167 forks source link

Setup using a class component in TypeScript #451

Closed akaldesign closed 1 year ago

akaldesign commented 1 year ago

Feature request is related to

davidjerleke commented 1 year ago

Hi @akaldesign,

Unfortunately, Embla Carousel dropped class component support a long time ago. It’s now only available using the useEmblaCarousel hook.

If you really want to use it in a class component, you need to use the vanilla embla-carousel package, and recreate what the useEmblaCarousel hook does under the hood in a class component way. However, I would encourage you to migrate to functional components as soon as possible.

Best, David