-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
Carousel 在卸载组件后,持续setState(),导致页面卡死 #1397
Comments
个人感觉是在unmount Carousel的时个,没有将定时器清除。 |
@afc163 demo我单独发你邮箱(afc163@gmail.com)里。请你查收一下。 |
帮助我们整理出一个能重现的例子,我没有要求公开项目代码.... |
@afc163 整理了个demo。 |
你给的 Demo 里重现了,确认是 react-slick 的问题,在上面的 issue 我给 react-slick 提了这个问题,等待 react-slick 修复。
|
已提 pr 。 |
官网案例里的 autoplay 切换回来还是卡死。。。 |
@afc163 什么时候能修复呢?项目等着升级呢。。。。 |
react-slick 的问题,我们也没有办法,可以去上面的 PR 中帮助我们催促官方合并。 |
如果是 banner,可以试试,banner-anim demo,,,,我已经对那 react-slick 彻底无语了。。。 |
其实我们是不想再引入更多的第三方组件了,再等一个迭代。 |
react-slick 已发布 0.12.1 。 |
这个问题还是存在,会一直报这个警告 |
What you did
在项目首页使用Carousel组件实现多个图片自动轮播功能。
What actually happened
从首页跳转到其他页面时,控制台出现如下警告(多条),最终导致页面卡死:
warning.js?0260:44 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the InnerSlider component.
Online demo
https://codepen.io/xiaoyi_1222/pen/KzoVNr
demo我打包了一份,在附件中。
Environment Information
The text was updated successfully, but these errors were encountered: