Replies: 2 comments 1 reply
-
don't use destructuring for ctx in parameters.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
@NikitaDudin Thanks now its working |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
`
export default function BottomSheet({show, hide}: BottomSheetProps) {
const dragY = useSharedValue(0);
const panHandler = useAnimatedGestureHandler<
PanGestureHandlerGestureEvent,
{y: number}>({
onStart: (_event, {y}) => {
y = dragY.value;
},
onActive: ({translationY}, ctx) => {
dragY.value = translationY + ctx.y;
},
});
const wrapperStyle = useAnimatedStyle(() => {
return {
transform: [{translateY: dragY.value}],
};
});
return (
<Animated.View style={[styles.container]}>
<Animated.View style={[styles.wrapper, wrapperStyle]}></Animated.View>
</Animated.View>
);
}
const styles = StyleSheet.create({
wrapper: {
flex: 1,
backgroundColor: 'red',
},
container: {
...StyleSheet.absoluteFillObject,
flex: 1,
width: '100%',
height: '100%',
zIndex: 10,
},
});
`
Beta Was this translation helpful? Give feedback.
All reactions