Animated.Component / createAnimatedComponent(Component) 与 Component 有何不同?

How does Animated.Component / createAnimatedComponent(Component) differ from Component?

我们正在尝试从 styled-components 项目中找出以下问题的原因:https://github.com/styled-components/styled-components/issues/389

对 refs + setNativeProps 进行了一些更改,在一个地方破坏了动画,假设是因为一些动画相关信息没有被正确传递。

因此问题是了解 createAnimatedComponent 如何改变初始组件,添加了什么?如果没有正确传递,什么会导致动画中断?

如果您知道可能导致此问题的原因,请提供想法/详细答案。

更新 与问题相关的重大更改发生在 this file 的某处以供参考 innerRef 向下传递 refisTag 函数检查它是否是本机组件。

animatable components can be animated. View, Text, and Image are already provided, and you can create custom ones with createAnimatedComponent. These special components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.

https://facebook.github.io/react-native/docs/animated.html