react-native-carousel-wrapper
Version:
This library is React Native wrapper of popular Native carousel library [iCarousel](https://github.com/PhilJay/MPAndroidChart) for ios and [CarouselLayoutManager](https://github.com/Azoft/CarouselLayoutManager), [Coverflow](https://github.com/crosswall/A
30 lines (27 loc) • 873 B
JavaScript
import React from 'react';
import { NativeModules, requireNativeComponent } from 'react-native';
const { RNCarouselManager } = NativeModules;
import PropTypes from 'prop-types';
import createClass from 'create-react-class';
const Carousel = createClass({
propTypes: {
wrap: PropTypes.bool,
items: PropTypes.array,
vertical: PropTypes.bool,
bounces: PropTypes.bool,
scrollEnabled: PropTypes.bool,
type: PropTypes.number,
perspective: PropTypes.number,
decelerationRate: PropTypes.number,
scrollSpeed: PropTypes.number,
bounceDistance: PropTypes.number,
onPressItem: PropTypes.func,
autoscroll: PropTypes.number
},
render: function() {
return <RNCarousel {...this.props} />;
}
});
const RNCarousel = requireNativeComponent('RNCarousel', Carousel);
Carousel.Type = RNCarouselManager.Type;
export default Carousel;