I implement a reaction-bootsrap carousel with a reduct reduction, and I get an error in the name.
I am using a controlled carousel and an error message appears when the carousel automatically changes the slide.
When the user clicks the prev button. The following buttons and manual changes all look fine.
I do not understand, should I add perseverance as a props or options for props or the like?
Here is my code:
Container:
import React, { Component } from 'react' import { connect } from 'react-redux' import { Link } from 'react-router' import store from 'store/configureStore' import Slides from 'components/SlideShow' import { getInitalSlides, handleSelect } from 'actions/SlidesActions' class Home extends Component { constructor(props) { super(props) this.state = { index: null, direction: null } this.handleSelect = this.handleSelect.bind(this) static fetchData({ store }) { return store.dispatch(getInitalSlides()) } componentDidMount() { this.props.getInitalSlides() } handleSelect(selectedIndex, e) {
and here is the corresponding bit in the component:
render() { return ( <Carousel activeIndex={this.props.getInitialState} direction={this.props.getInitialStateD} onSelect={(selectedIndex,e)=>this.props.slidesControl(selectedIndex,e)} > { this.props.slides.map((s)=>{ let id = s.get('id') let title = s.get('title') let image = s.get('image') let alt = s.get('alt') let caption = s.get('caption') return( <Carousel.Item key={id} > <img width={900} height={500} alt={s.get('alt')} src={image} alt={alt}/> <Carousel.Caption> <h3>{title}</h3> <p>{caption}</p> </Carousel.Caption> </Carousel.Item> ) }) } </Carousel>) } }
Edit: Here is the appropriate bootstrap reaction carousel code (where the error is thrown)
var onSelect = this.props.onSelect; if (onSelect) { if (onSelect.length > 1) {
source share