Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setupSwipe() {
if (!this.swipeContainer) return;
let options = this.swipeOptions();
if (this.instance) {
this.instance.setup(options);
if (options.auto) this.instance.restart();
} else {
this.instance = new SwipeJS(this.swipeContainer, options);
}
}
componentDidMount() {
const {
startSlide,
speed,
auto,
draggable,
continuous,
autoRestart,
disableScroll,
stopPropagation,
callback,
transitionEnd
} = this.props;
this.instance = new SwipeJS(this.refs.swipe, {
startSlide,
speed,
auto,
draggable,
continuous,
autoRestart,
disableScroll,
stopPropagation,
callback,
transitionEnd
});
}