Skip to content

Instantly share code, notes, and snippets.

@gigobyte
Created July 4, 2025 15:54
Show Gist options
  • Select an option

  • Save gigobyte/ac9704fb774d67a126768a03f2563bf9 to your computer and use it in GitHub Desktop.

Select an option

Save gigobyte/ac9704fb774d67a126768a03f2563bf9 to your computer and use it in GitHub Desktop.
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