2

We use react-responsive-carousel in our Next.js project. When we replaced img with Image to optimize thumbnail image size, thumbnails disappeared. Do you know why?

1 Answer 1

1

Looks like it's a limitation of react-responsive-carousel:

Note that it's not possible to get images rendered inside custom components. Carousel will find the thumbs if they are rendered as direct children of the carousel or if they are inside a div or another normal html element in a way that it's possible to access the children of these elements from the carousel. For performance reasons, it's not possible to get images inside custom components.

next/image is a wrapper around the <img> element, which means Carousel is not able to pick up the images for the thumbnails.

Sign up to request clarification or add additional context in comments.

1 Comment

Would you suggest an other carousel tool for Next.js?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.