根据React文档,useEffect将在重新运行useEffect部分之前触发清理逻辑。Ifyoureffectreturnsafunction,Reactwillrunitwhenitistimetocleanup...ThereisnospecialcodeforhandlingupdatesbecauseuseEffecthandlesthembydefault.Itcleansupthepreviouseffectsbeforeapplyingthenexteffects...但是,当我在useEffect中使用requestAnimationFrame和cancelAnim