Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

529
Views
How to dynamically update Swiper in response to new Slide Array?

I want to retrieve data dynamically and insert it as a slide in my slider. I am using Swiper to do this. However, I run into problems because Swiper does not update as the number of slides in the array increases. Only when I reinitialize Swiper after the new slides are available does Swiper find the new array. I have found the observer parameter to reinitialize Swiper when the children are updated. However, I can not set this to active, i.e. observer:true is not possible.

How do I activate the observer Parameter. I have tried the following approach?

        <Swiper
          slidesPerView={1.2}
          spaceBetween={10}
          loop={false}
          centeredSlides={true}
          observer={true}
          observeParents={true}
          pagination={{
            clickable: true,
          }}
          onSlideChange={
            (swiper) =>
              handleIndexChange(swiper.activeIndex)
          }
          onSwiper={(swiper) => console.log(swiper)}
        >
          {ShowItems}
        </Swiper>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!