react

react中使用antd警告:findDOMNode is de

2020-08-28  本文已影响0人  匆匆那年_海

警告

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中的react严格模式: StrictMode,养鹅模式不支持findDOMNode

解决办法:

index.js挂载 App 的外面删除<React.StrictMode></React.StrictMode>标签,

原文作者:匆匆那年_海,博客主页:https://www.jianshu.com/u/910c0667c515
95后前端汉子,爱编程、优秀、聪明、理性、沉稳、智慧的程序猿一枚。

上一篇 下一篇

猜你喜欢

热点阅读