import * as React from 'react'; import { StyleSheet, Text, View, ViewStyle, NativeSyntheticEvent, NativeScrollEvent } from 'react-native'; import Swiper, { SwiperState } from 'react-native-swiper'; class SwiperTest extends React.Component { constructor(props: {}) { super(props); } callback = ( event: NativeSyntheticEvent, state: SwiperState, context: Swiper ) => { console.log(this.callback.name, event, state, context); } render(): React.ReactElement { return ( ()} height={100} width={200} nextButton={NEXT} prevButton={PREV} onScrollBeginDrag={this.callback} onMomentumScrollEnd={this.callback} onTouchStartCapture={this.callback} onTouchStart={this.callback} onTouchEnd={this.callback} onResponderRelease={this.callback} style={styles.wrapper}> Hello Swiper Beautiful And Simple ); } } const styles = StyleSheet.create({ wrapper: { }, slide1: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#9DD6EB' }, slide2: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#97CAE5' }, slide3: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#92BBD9' }, text: { color: '#fff', fontSize: 30, fontWeight: 'bold' } });