Motion.Image
Animatable Image. animate, initial, exit, and gesture take the ImageStyle type, so tintColor autocompletes here, and the other primitives reject it.
import { Motion } from '@rootnative/inertia'
export function Avatar({ source }: { source: { uri: string } }) {
return (
<Motion.Image
source={source}
initial={{ opacity: 0, scale: 0.9 }}
animate={{ opacity: 1, scale: 1 }}
transition={{
opacity: { type: 'timing', duration: 200 },
scale: { type: 'spring', tension: 220, friction: 18 },
}}
style={avatarStyles.image}
/>
)
}
Tree-shaken import
import { MotionImage } from '@rootnative/inertia/image'
Animatable keys
opacity, translateX, translateY, scale, scaleX, scaleY, rotate, rotateX, rotateY, width, height, borderRadius, tintColor, backgroundColor, borderColor.
<Motion.Image
source={icon}
initial={{ tintColor: '#9ca3af' }}
animate={{ tintColor: active ? '#0a84ff' : '#9ca3af' }}
transition={{ type: 'timing', duration: 180 }}
/>