react-native-reanimated-bottom-sheet
react-native-reanimated-bottom-sheet copied to clipboard
feat(styles): added ability to pass in animated node for border radius
Description
This PR adds the ability to be able to pass an animated node into the borderRadius prop, which will allow for animation on that prop.
Example
const SomeComponent = () => {
const bottomSheetCallbackAnimatedNode = useState<Animated.Value<number>>(new Animated.Value(0));
// Interpolate based off of callback node
const bottomSheetBorerRadiusAnimatedNode = Animated.interpolate(bottomSheetCallbackAnimatedValue, {
inputRange: [0, 1],
outputRange: [0, 20],
extrapolate: Animated.Extrapolate.CLAMP,
});
return (
<BottomSheet
callbackNode={bottomSheetCallbackAnimatedNode}
borderRadius={bottomSheetBorerRadiusAnimatedNode}
//...otherProps
/>
);
}
+1
@osdnk Thoughts?