nandorojo/moti

RFC: Built-in Moti + SVG Integration

nandorojo opened this issue · 0 comments

It would be nice to do something like this:

import { motify } from 'moti'
import { Rect } from 'react-native-svg'

const MotiRect = motify(Rect)({ isSvg: true })

Then, we could automatically animate SVG props:

<MotiRect 
  animate={{
    x: width / 2,
  }}
/>

All SVG props would be animatable there. Let me know if you have any thoughts about this API.

This would bring the benefits of all Moti APIs and its simplicity to SVGs. It would also let you use animate presence with SVG animations.

Screenshot 2023-01-30 at 4 24 32 PM