[英]WARNING: findDOMNode is deprecated in StrictMode, react-redux-notify
I am getting this warning while using, react-redux-notify我在使用react-redux-notify时收到此警告
index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of CSSTransitionGroupChild which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: ---/react-strict-mode-find-node
in div (created by Notification)
in Notification (created by Notify)
in CSSTransitionGroupChild (created by TransitionGroup)
in div (created by TransitionGroup)
in TransitionGroup (created by CSSTransitionGroup)
in CSSTransitionGroup (created by Notify)
in div (created by Notify)
in Notify (created by ConnectFunction)
in ConnectFunction (at App.js:56)
in div (at App.js:55)
in Provider (at App.js:54)
in App (at src/index.js:9)
in StrictMode (at src/index.js:8)
How to correct this?如何纠正这个?
in index.js
remove <React.StrictMode> wrapper在
index.js
移除 <React.StrictMode> 包装器
ReactDOM.render( <React.StrictMode>
<React.StrictMode> //remove this
<App />
<React.StrictMode/> //remove this as well.
,
document.getElementById('root')
)
to到
ReactDOM.render(
<App />,
document.getElementById('root')
)
This is an error probably from a library you are using to say that the ReactDOM.findDOMNode function is now deprecated but it still works (it may be removed in the future).这是一个错误,可能来自您正在使用的库,表示 ReactDOM.findDOMNode 函数现在已弃用,但它仍然有效(将来可能会被删除)。
In StrictMode, the error will show up but it is not advisable to remove StrictMode because of the error!在 StrictMode 中,会出现错误,但不建议删除 StrictMode因为错误! It is better to ignore this error or reach out to the library causing this by reporting the issue.
最好忽略此错误或通过报告问题联系导致此错误的库。
FYI this is a known issue in react-bootstrap.仅供参考,这是react-bootstrap 中的一个已知问题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.