Provider
Overview
useSwiperContext
is hooks to read internal context of scale swiper
Type
interface SwiperContextType {
itemCount: number; // data length
itemWidth: number; // item width calculated from slide count
scrollX: Animated.Value; // FlatList animated value of content offset x
activeIndex: number; // current centered item index
}
Example
import { useSwiperContext } from 'react-native-awesome-swiper';
const UI = () => {
const { itemCount, itemWidth, scrollX, activeIndex } = useSwiperContext();
return <View />;
};