升级React18 后 antD (Menu mode="horizontal")移动端报错问题

430 阅读1分钟

一、浏览器移动端模式下的antD Menu mode="horizontal"

点击menu的item 报错如下:

Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

我们等待Ant design 团队解决这个问题或者切换mode为 vertical 或 inline。