Last active
August 8, 2020 05:32
-
-
Save spencerfeng/b5f142a5c1f407ce28984a884bf159c8 to your computer and use it in GitHub Desktop.
This gist is used in this medium article: When React Native Reanimated nodes get evaluated
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
const MyOpacityComponent = () => { | |
const [toggled, setToggled] = useState(false) | |
const opacity = useRef<Value<number>>(new Value(0)) | |
useCode(() => [set(opacity.current, runOpacityTimer())], []) | |
return ( | |
<Animated.View style={{ opacity: opacity.current }}> | |
<Text>Hello World</Text> | |
</Animated.View> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment