react中使用antd警告:Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instan...

 

警告内容:

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Wave which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node


 

 

只要使用antd的组件就会有警告存在  

警告原因:

是因为 react中的严格模式: `StrictMode`

react严格模式

解决办法:

在`index.js`中挂载 App 的外面有这样一个标签 

只要把这个标签删除掉就可以了


 

 

posted @ 2020-07-24 10:04  暗恋桃埖源  阅读(2498)  评论(0编辑  收藏  举报