Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题是,当我在应用程序中只使用没有胜利图表的滑块时,只实现滑块,那么滑块就没有问题。但是当我将滑块与 victort 图表一起使用时,滑块会滞后,并且状态值的变化很晚才反映在屏幕上。
要查看带有屏幕截图/GIF 的完整详细信息,请单击此处
这是因为您将值发送到状态作为拖动onChange,这将导致每次重新渲染。
onChange
如果你渲染的东西很少,什么也不会发生,但是当渲染更重时,这会变得更明显。
这可以通过两种方式解决:
componentShouldUpdate()
onSlidingComplete