_chooseLayout () {
    const { slides } = this.props
    if (this.props.layout === 'random') {
      if (slides.length <= 5) {
        return slides.length > 1 ? slides.length : 2
      } else {
        return Math.floor((Math.random() * 4)) + 2
      }
    } else {
      return this.props.layout;
    }
  }
/*
    Selects a layout between 2, 3, 4 and 5 slides randomly.
    If the number of slides are less than 6, return the number of slides as layout
    or 2, whichever is higher.
  */
Selects a layout between 2, 3, 4 and 5 slides randomly.
If the number of slides are less than 6, return the number of slides as layout
or 2, whichever is higher.
Selects a layout between 2 3 4 and 5 slides randomly . If the number of slides are less than 6 return the number of slides as layout or 2 whichever is higher .
_chooseLayout () {
    const { slides } = this.props
    if (this.props.layout === 'random') {
      if (slides.length <= 5) {
        return slides.length > 1 ? slides.length : 2
      } else {
        return Math.floor((Math.random() * 4)) + 2
      }
    } else {
      return this.props.layout;
    }
  }
_chooseLayout ( ) { const { slides } = this . props if ( this . props . layout === 'random' ) { if ( slides . length <= 5 ) { return slides . length > 1 ? slides . length : 2 } else { return Math . floor ( ( Math . random ( ) * 4 ) ) + 2 } } else { return this . props . layout ; } }
Selects a layout between 2, 3, 4 and 5 slides randomly.
Selects a layout between 2 3 4 and 5 slides randomly .