Reanimated Animation Wrapper (RN)

Someone here that has any example on how I can extend AnimationWrapperProps so that I can pass in custom animations or name of custom animations to trigger them? And also if you have any suggestions on how I can get the onPress to trigger animations that would be great 😄
type AnimationWrapperProps = ViewProps &
Pick<AnimateProps<ViewProps>, 'entering' | 'exiting'> &
Pick<PressableProps, 'onPress'>;

const AnimationWrapper = ({ children, onPress, ...rest }: AnimationWrapperProps) => {
return (
<Animated.View {...rest}>
<Pressable onPress={onPress}>{children}</Pressable>
</Animated.View>
);
};

export default AnimationWrapper;
type AnimationWrapperProps = ViewProps &
Pick<AnimateProps<ViewProps>, 'entering' | 'exiting'> &
Pick<PressableProps, 'onPress'>;

const AnimationWrapper = ({ children, onPress, ...rest }: AnimationWrapperProps) => {
return (
<Animated.View {...rest}>
<Pressable onPress={onPress}>{children}</Pressable>
</Animated.View>
);
};

export default AnimationWrapper;
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server