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

react 中使用 antd 警告

      • 警告内容:
      • 警告原因:
      • 解决办法:

警告内容:

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
react使用antd警告:Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance_第1张图片
我只要用antd的组件就会有警告存在

警告原因:

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

解决办法:

(这是目前找到的唯一办法 _)
index.js中挂载 App 的外面有这样一个标签
只要把这个标签删除掉就可以了
react使用antd警告:Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance_第2张图片

你可能感兴趣的:(react,ant,react,ant)