Created
June 12, 2020 07:58
-
-
Save kmagiera/239b75c6aa2c5835eac620f5091bb37c 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 SomeComponent() { | |
const randomWidth = useSharedValue(64); | |
const style = useAnimatedStyle(() => { | |
return { | |
// get the value carried by `randomWidth` SV by accessing value field | |
width: randomWidth.value, | |
}; | |
}); | |
return ( | |
<View style={styles.container}> | |
<Animated.View style={[styles.box, style]} /> | |
</View> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment