79777632

Date: 2025-09-28 22:50:05
Score: 1
Natty:
Report link

I could remember I had this problem, but in a Vanilla JS project, not React.

The source of the problem was the fact that Swiper must take a unique DOM element to be initialized.

Look at the initial part:

https://swiperjs.com/get-started#initialize-swiper

So imagine on a page, you have two or three Swipers.

If you use the ".swiper" class for all the Swipers on the page, you would face these kinds of problems:

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Ali Nabizadeh