Closed minimaldesign closed 8 years ago
You can do this:
afterSlide(newSlideIndex) {
this.setState({ slideIndex: newSlideIndex });
this.refs.carousel2.goToSlide(newSlideIndex);
}
https://github.com/bvasko/nuka-carousel/tree/sync-two-carousels
I have two carousels on one page, and I need to keep there currentSlide in sync, but I can't use mixins (external requirements). What would be the best way to set the currentSlide of one carousel with the value of the other? (and vice versa…).
I've tried using the
afterSlide
prop without much success so far… Any pointer in the right direction much appreciated!