react使用antd的From组件报错解决方案

799 阅读1分钟

使用时如报如下的错误: index.js:1 Warning: Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: LocaleReceiver, Trigger

解决方法: 找到index.js,删除index.js中React.StrictMode

删除:

随后再次运行: