How to pass props to children components #3525
Unanswered
reichhartd
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My question is which ways exist, to give animated values to child components.
What I've found so far is that the preferred way is to pass the shared value
ShareValue<TValue>
fromuseSharedValue
oruseDerivedValue
.But we have a few use cases where the animated styles differ a lot, and instead of passing many different props, a more better way would be to pass a value with the animated styles
AnimatedStyleProp<ViewStyle | ImageStyle | TextStyle>
. This is sometimes possible, sometimes it isn't, as the following expo snacks show:I'd like to collect all the possibilities in this discussion, understand the reasons why, and then put this in the documentation accordingly so it's clearer for future developers.
Beta Was this translation helpful? Give feedback.
All reactions