Follw the usage, I can't use this carousel.
DeepestDesire opened this issue · 1 comments
DeepestDesire commented
import React from 'react';
import TouchCarousel from 'react-touch-carousel'
class App extends React.Component {
carouselComponent() {
return (
<div style={{backgroundColor: "yellow", height:400, width: "90%"}}>
</div>
)
}
renderCard(index, modIndex) {
return (
<div style= {{color: "red"}}>
{index}
<div>
<div className='carousel-title'>{'title'}</div>
<div className='carousel-text'>{'text'}</div>
</div>
</div>
)
}
render() {
return (
<TouchCarousel
component={this.carouselComponent.bind(this)}
cardCount={3}
cardSize={375}
renderCard={this.renderCard.bind(this)}
loop
autoplay={3000}
/>
)
}
}
export default App
I can't see renderCard's component
xiaody commented
I guess it should be something like
carouselComponent(props) {
return (
<div style={{backgroundColor: "yellow", height:400, width: "90%"}}>
{props.children}
</div>
)
}