Replies: 1 comment
-
I had a look into the code, it looks like easy to extend the api to accept a SharedValue as useSharedValue parameter. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
For some reason, I need to initialize a SharedValue with the value of another SharedValue (ParentComponent provide a SharedValue to ChildComponent and the ChildComponent need to animate the value in another way).
Can you please explicite what is the best way to do that ?
this natural way is intialize it like this:
But it causes a warning on last version as we access to the .value from JS thread.
I currently workaround it like this:
But it is not really clean as we have a small time where childSharedValue is 0
ideally, I would like to write it like this:
but use useSharedValue doesn't accept a SharedValue as prop, but I think it can be an interesting enhancement.
Beta Was this translation helpful? Give feedback.
All reactions