javascript – Animated.Component / createAnimatedComponent(Component)如何与Component不同?

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

有一些修改对于在一个地方打破动画的setNativeProps做了一些修改,假设因为一些动画相关信息没有被正确传递.

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

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

UPDATE
关于这个问题的突破变化发生在this file年的某个地方,参考innerRef传递下来的ref,isTag函数检查它是否是一个本机组件.

解决方法

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

相关文章

前言 做过web项目开发的人对layer弹层组件肯定不陌生,作为l...
前言 前端表单校验是过滤无效数据、假数据、有毒数据的第一步...
前言 图片上传是web项目常见的需求,我基于之前的博客的代码...
前言 导出Excel文件这个功能,通常都是在后端实现返回前端一...
前言 众所周知,js是单线程的,从上往下,从左往右依次执行,...
前言 项目开发中,我们可能会碰到这样的需求:select标签,禁...