我正在编写一个 Cesium/Resium 应用程序,其中包含约 12000 个可点击的动画点。 我收到了 React 警告
Maximum update depth exceeded
。
当有 <5000 points, there's no warning, but somewhere in the 7-8000 range, I tend to see this warning.
When debugging in the browser, my call stack is a lot of recursivelyTraverseMutationEffects
后跟很多 postMessage (async)
我已经消除了该警告的两个来源,即“愚蠢的递归”。我有一个 useEffect
正在更新其触发器。
根据完整的错误消息,此错误意味着
至少完成了
在没有意外递归的情况下,获得 React“超出最大更新深度”是合理的。
我们尝试了渲染大小并使实体变得非常小,现在我们可以在遇到 Maximum update depth exceeded
警告之前显示更多实体。