是否可以使用成帧器运动为 dom 重新排序设置动画

Is it possible to animate dom reorderings with framer motion

我如何制作动画(或过渡)dom 使用成帧器运动重新排序?我读过一种称为 FLIP 的技术(提到 here 但我不确定我将如何将其实施到成帧器运动中。

您可以通过向您的运动组件添加 layout 道具来实现。确保您使用的是 framer-motion 2.0 及更高版本,因为在该版本以下它曾经是 layoutTransition={transition object}.

在此处查看工作示例https://codesandbox.io/s/framer-motion-reorder-animation-forked-4jbqh?file=/src/Example.tsx