question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

swiper.appendSlide, swiper.prependSlide with React Components

See original GitHub issue

Hi! How can i append, prepend slides like this

swiper.append(<MyComponent {..props} />)

or like this

<div class="swiper-slide"><MyComponent {..props} /></div>

Now i see, that i can use this opts only with DOM Node like

'<div class="swiper-slide">Slide</div>'

Otherwise i get an error

TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kidjp85commented, Jan 23, 2018

Hi @kryl

For now, I don’t think we support prepend or append slide.

0reactions
LennyLipcommented, Nov 8, 2018

Thanks, @danedavid I tried shouldSwiperUpdate, but the slider did not update after new slides added to exists slides list. With rebuildOnUpdate new slides appearing, but navigation moved to the first slide.

Can you please give me your code with a working example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swiper React Components
Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.
Read more >
How to manipulate slide array of swiper.js in React?
I am using swiper.js and React to do this. ... prependSlide([ '<div class="swiper-slide">Slide ' + (--prependNumber) + '</div>', ...
Read more >
Swiper js add and remove slide (append and ... - CodePen
URL Extension Required. When linking another Pen as a resource, make sure you use a URL Extension of the type of code you...
Read more >
vue-awesome-swiper | Homepage
vue-awesome-swiper GitHub homepage. ... vue-awesome-swiper. Swiper component for @vuejs ... Prepend slide. Append slide. Pop slide. Shift slide.
Read more >
SwiperJS append slide in raw HTML, then adding event ...
swiper.appendSlide() takes in raw HTML as its function argument and does not accept a React component. swiper.current because I attached a ref ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found