Skip to content

Instantly share code, notes, and snippets.

@JDMathew
Created August 22, 2023 00:25
Show Gist options
  • Save JDMathew/b803a3263a4911c4538c8c98d054a277 to your computer and use it in GitHub Desktop.
Save JDMathew/b803a3263a4911c4538c8c98d054a277 to your computer and use it in GitHub Desktop.
reanimated useAnimatedProps typescript type bug reproduction for pointerEvents
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