@kolking/react-native-parallax-swiper
Version:
React Native component for building an impressive horizontal swiper with a parallax effect.
16 lines (13 loc) • 388 B
text/typescript
import { createContext } from 'react';
import { Dimensions } from 'react-native';
import { makeMutable, SharedValue } from 'react-native-reanimated';
type ContextType = {
width: number;
totalViews: number;
scrollX: SharedValue<number>;
};
export const Context = createContext<ContextType>({
width: Dimensions.get('window').width,
totalViews: 0,
scrollX: makeMutable(0),
});