How to use the react-swipeable-views-utils/lib/autoPlay function in react-swipeable-views-utils

To help you get started, we’ve selected a few react-swipeable-views-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TeamWertarbyte / material-auto-rotating-carousel / src / SwipableCarouselView.js View on Github external
import React from 'react'
import autoPlay from 'react-swipeable-views-utils/lib/autoPlay'
import virtualize from 'react-swipeable-views-utils/lib/virtualize'
import bindKeyboard from 'react-swipeable-views-utils/lib/bindKeyboard'
import SwipeableViews from 'react-swipeable-views'
import { modulo } from './util'

const VirtualizeSwipeViews = bindKeyboard(virtualize(SwipeableViews))
const VirtualizeAutoPlaySwipeViews = autoPlay(VirtualizeSwipeViews)

const carouselSlideRenderer = (children) =>
  ({index, key}) => React.cloneElement(children[modulo(index, children.length)], {key})

export default function Carousel ({children, autoplay, ...other}) {
  const slideRenderer = carouselSlideRenderer(children)
  return autoplay ? (
    
  ) : (

react-swipeable-views-utils

react-swipeable-views utility modules

MIT
Latest version published 4 years ago

Package Health Score

62 / 100
Full package analysis

Similar packages