Skip to content

Instantly share code, notes, and snippets.

@reime005

reime005/rn-animated-star-rating-8.js Secret

Last active Jan 13, 2021
Embed
What would you like to do?
const changeModalPosition = React.useCallback(
(gs: PanResponderGestureState) => {
const value = screenHeight - MODAL_HEIGHT + gs.dy;
// prevent dragging too high or too low
if (value >= screenHeight || value < screenHeight - MODAL_HEIGHT) {
return;
}
pan.y.setValue(value);
},
[],
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment