Created
July 4, 2025 15:54
-
-
Save gigobyte/ac9704fb774d67a126768a03f2563bf9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function Screen() { | |
| const opacity = useSharedValue(0) | |
| const [dimensions, setDimensions] = useState({ height: 0, width: 0 }) | |
| const containerAnimatedStyle = useAnimatedStyle(() => { | |
| 'worklet' | |
| return { | |
| opacity: opacity.value, | |
| transform: [{ scale: opacity.value }], | |
| } | |
| }) | |
| useEffect(() => { | |
| opacity.value = withTiming(1, { duration: 200 }) | |
| }, []) | |
| return ( | |
| <Animated.View style={containerAnimatedStyle}> | |
| <Pressable | |
| dimensionsAfterResize={dimensions} | |
| onLayout={(e) => setDimensions(e.nativeEvent.layout)} | |
| /> | |
| </Animated.View> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment