0.18 Release #184
nandorojo
announced in
Announcements
Replies: 1 comment
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
yarn add moti@canary
Features
animate
propanimate
function propMotiPressable
Shared Values with
animate
propIn addition to a plain object, you can pass a function to the
animate
prop. As long as it hasworklet
at the top of the function, you can now use any shared/derived values inside of the animate prop!These values will automatically animate for you, so you don't need to use
withTiming
or import any hooks likeuseAnimatedStyle
.This will work with React Native Gesture Handler gestures too!
Pass function child to
MotiPressable
As a consequence of the
animate
function supporting a worklet, I added a function as children ofMotiPressable
. This looks a lot like thePressable
fromreact-native
. As long as you readinteraction.value
inside of theanimate
worklet, it will update responsively.This discussion was created from the release 0.18 Release.
Beta Was this translation helpful? Give feedback.
All reactions