1.0.0 • Published 3 years ago
tv-carousel v1.0.0
tv-carousel
使用
$ yarn install tv-carousel
import Carousel from 'tv-carousel';
export class MyCarousel extends Component {
_renderItem = ({item, index}) => {
return (
<View style={styles.slide}>
<Text style={styles.title}>{ item.title }</Text>
</View>
);
}
render () {
return (
<Carousel
ref={(c) => { this._carousel = c; }}
data={this.state.entries}
renderItem={this._renderItem}
sliderWidth={300}
itemWidth={300}
/>
);
}
}
1.0.0
3 years ago