Moti has the same API for transforms as a normal React Native component.
It also comes with some added convenience.
Like always, you can do this:
Writing a transform array can be bulky. If you only have one transform, you can pass it to Moti directly:
If you're using multiple transforms together, such as
translateY, you must use an array.
This example is okay, since
scale is the only transform:
But this won't work:
Make sure the order in the
animate prop is the same. In this case, we put
transform works like normal. Simply pass an array in place of your value
That's equivalent to doing this: