Created
August 22, 2023 00:25
-
-
Save JDMathew/b803a3263a4911c4538c8c98d054a277 to your computer and use it in GitHub Desktop.
reanimated useAnimatedProps typescript type bug reproduction for pointerEvents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import Animated from 'react-native-reanimated'; | |
const Component ({scrollY}: {scrollY: Animated.SharedValue<number>}) => { | |
const headerProps = useAnimatedProps( | |
() => ({ | |
pointerEvents: | |
scrollY.value < APPEARANCE_OFFSET | |
? 'none' | |
: 'auto', | |
}), | |
[], | |
); | |
return (<Animated.View | |
animatedProps={headerProps} | |
/>); | |
}; | |
const APPEARANCE_OFFSET = 60; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment