Skip to content
Discussion options

You must be logged in to vote

I believe you should only use that dependency array if your animated style worklet function depends on values from the JS thread. You do not need to include shared values in the dependency array. For example:

const [isShown, setIsShown] = useState(false)
const animatedStyle = useAnimatedStyle(() => ({
  opacity: isShown ? 1 : 0
}),
[isShown])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JasperH8g
Comment options

Answer selected by JasperH8g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants