Skip to content
Discussion options

You must be logged in to vote

@Alvi24, thanks for clarifying.

There are quite a few benefits to controlling Embla via an API (like emblaApi.scrollTo()) instead of relying on React state:

  • It lets you granularly create only the state you actually need, instead of a component managing a large internal state for many features you might never use. This keeps things more lightweight and flexible.

  • Whenever the core package (embla-carousel) API changes, the React wrapper (and the Vue, Svelte, Solid versions) automatically get access to those updates. There’s no need to manually expose new state or remove old ones, which reduces maintenance overhead and avoids lag between packages and package releases.

  • It avoids unnecess…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Alvi24
Comment options

@davidjerleke
Comment options

Answer selected by davidjerleke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Question about how to achieve something react Issue is related to React
2 participants