|
|
1
1
这个图书馆最初是一个活生生的分支,内部仍然有很多相似之处。Christopher Chedeau的动画有一个专门针对网络的回购协议: https://github.com/animatedjs/animated 不幸的是,它不再被维护。 它的工作方式是通过createAnimatedComponent(以“动画”的形式公开)包装组件: https://github.com/react-spring/react-spring/blob/master/src/animated/createAnimatedComponent.tsx 这个高阶组件拦截样式和属性(它们不是原始值,而是自更新类)。它调用“applyAnimatedValues”来写入外部的目标React。每个目标(dom、native、konva、three等)都必须填写。例如,dom如何应用这些道具: https://github.com/react-spring/react-spring/blob/master/src/targets/web/globals.ts#L82-L127 希望能有帮助! |