how to use "useAnimatedProps" or display a sharedValue in the render without runOnJS with setState? #3273
Unanswered
andrewdang17
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.
-
I'm a little confused on the documentation and wondering I am understanding it correctly. I want to be able to pass a
sharedValue
to a react component and have that component re-render if the sharedValue is updated from the parent component, and also display thatsharedValue
as well. It seems like animatedProps would work but it doesn't. Here's simplified code of a component I am building that is basically a draggable status bar (broken up into chunks) that change color as you drag it as well as displaying the progress.percentProgressed.value
which is aderivedValue
cannot be shown in render, and animatedProps also does not appear to update if I access the return value. I could use save the state of the progressuseState
in theonActive
withrunOnJs
, but this is actually really slow and lags on physical devices (works fine on the simulator though with no lag). Any ideas on how I'd accomplish this?Beta Was this translation helpful? Give feedback.
All reactions