I'm trying to animate a card's border radius and shadow opacity but instantly closes on IOS. I'm not sure if I'm using reanimated correctly though. I feel like there is crucial mistake I'm making. Here is the code.
const anim = loop({
autoStart: true,
duration: 1750,
easing: EasingNode.inOut(EasingNode.ease),
});
const riskCardStyle = useAnimatedStyle(() => {
const borderRadius = Animated.interpolateNode(anim, {
inputRange: [-1, 0, 1],
outputRange: [30, 0, 30],
extrapolate: Extrapolate.CLAMP,
});
const shadowOpacity = Animated.interpolateNode(anim, {
inputRange: [-100, 0, 100],
outputRange: [1, 0, 1],
extrapolate: Extrapolate.CLAMP,
});
return {
backgroundColor: Colors.white,
flex: 1,
position: 'relative',
borderTopLeftRadius: borderRadius,
borderTopRightRadius: borderRadius,
shadowColor: 'rgba(168, 179, 255, 0.4)',
shadowOffset: {
width: 0,
height: -3,
},
shadowRadius: 20,
shadowOpacity,
};
});
thanks in advance