AnimatedPressable dynamic style prop breaking styling #8232
Answered
by
MatiPl01
peterjskaltsis
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
MatiPl01
Sep 12, 2025
Replies: 1 comment
-
Hey @peterjskaltsis! It seems that we currently don't support dynamic styles on animated components. What can you do instead is passing the function as a child property, leaving the pressable component unstyled and styling the child <Pressable>
{({ pressed }) => (
<Animated.View
style={{
backgroundColor: pressed ? 'green' : 'red',
transitionDuration: '200ms', // add this if you want a CSS transition
padding: 12,
borderWidth: 1,
borderColor: 'white',
}}>
<Text>No styles?</Text>
</Animated.View>
)}
</Pressable> And thank you for asking about that. It seems that we should implement the dedicated |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
MatiPl01
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @peterjskaltsis!
It seems that we currently don't support dynamic styles on animated components. What can you do instead is passing the function as a child property, leaving the pressable component unstyled and styling the child
Animated.View
like I did here:And thank you for asking about that. It seems that we should implement the dedica…