Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

创建React动画有哪些方式? #10

Open
careteenL opened this issue Apr 17, 2020 · 0 comments
Open

创建React动画有哪些方式? #10

careteenL opened this issue Apr 17, 2020 · 0 comments
Labels
每日一问 每天一道面试题

Comments

@careteenL
Copy link
Owner

创建React动画有以下几种:

  • 1.基于定时器或requestAnimationFrame的间隔动画;使用定时器可能会有掉帧问题,而使用requestAnimationFrame则性能较好,完全使用js,不依赖css,帧数跟屏幕刷新率一致,页面运行到后台会自动暂停提高性能。
  • 2.基于css3中的animation和transition简单动画;有较高的性能,代码量少,但是只能依赖于css效果,对于复杂动画比较难实现跟控制。
  • 3.React动画插件CssTransitionGroup;性能比较好,但限定于入场跟出场场景。
  • 4.其他第三方动画库。
@careteenL careteenL added the 每日一问 每天一道面试题 label Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
每日一问 每天一道面试题
Projects
None yet
Development

No branches or pull requests

1 participant