You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a bottom sheet modal that slides from bottom to top and I want to add pan to slide from top to bottom like Facebook comment section but it's not panning please check my code
`import Modal from 'react-native-modal';
function BottomSheet({show, hide, children}) {
const Y = useRef(new Value(0)).current;
const gestureState = useRef(new Value(State.UNDETERMINED)).current;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I made a bottom sheet modal that slides from bottom to top and I want to add pan to slide from top to bottom like Facebook comment section but it's not panning please check my code
`import Modal from 'react-native-modal';
function BottomSheet({show, hide, children}) {
const Y = useRef(new Value(0)).current;
const gestureState = useRef(new Value(State.UNDETERMINED)).current;
const handlePan = event([
{
nativeEvent: {translationY: Y},
},
]);
useCode(() => [debug('Y value', Y)], []);
return (
<Modal
isVisible={show}
onBackButtonPress={hide}
onBackdropPress={hide}
backdropColor={color.white}
backdropOpacity={0.5}
style={{
margin: 0,
justifyContent: 'flex-end',
}}>
<Animated.View
style={{
backgroundColor: color.white,
borderTopStartRadius: 32,
borderTopEndRadius: 32,
elevation: 10,
transform: [{translateY: Y}],
}}>
{children}
</Animated.View>
);
}`
Beta Was this translation helpful? Give feedback.
All reactions