Skip to content

Auto Height in React #287

Closed Answered by davidjerleke
Tambouil asked this question in Help
Feb 22, 2022 · 2 comments · 8 replies
Discussion options

You must be logged in to vote

Hi @Tambouil,

Thanks for your question. It seems like you've misunderstood the documentation. Here's what the documentation say:

  • The Embla Carousel constructor accepts an optional plugin array as the thrid argument, which enables you to extend your carousels with additional features.

Here are some problems I found with your setup:

  • You're adding each plugin in a separate array. All plugins should be in the same array.
  • You're not referring to the autoheight.current when passing the AutoHeight plugin to Embla.
  • The default options for the AutoHeight plugin is auto so no need to pass any options to it.

Try this:

import React, { useState, useEffect, useCallback, useRef } from "react";
import {

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@davidjerleke
Comment options

@Tambouil
Comment options

@davidjerleke
Comment options

@Tambouil
Comment options

@davidjerleke
Comment options

Answer selected by Tambouil
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants