简体   繁体   English

警告:在 StrictMode 中不推荐使用 findDOMNode,react-redux-notify

[英]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> wrapperindex.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.

相关问题 警告:使用 react-bootstrap Navbar 时,在 StrictMode 中不推荐使用 findDOMNode - Warning: findDOMNode is deprecated in StrictMode when using react-bootstrap Navbar 这是什么意思? 警告:在 StrictMode 中不推荐使用 findDOMNode - What does this mean? Warning: findDOMNode is deprecated in StrictMode findDOMNode 在 StrictMode React 材质 UI 中已弃用 - findDOMNode is deprecated in StrictMode React material UI React-Transition-Group:在 StrictMode 中不推荐使用 findDOMNode - React-Transition-Group: findDOMNode is deprecated in StrictMode 使用 React,在使用 react-transition-group 时,在 StrictMode 中不推荐使用 findDOMNode 作为警告 - Using React, findDOMNode is deprecated in StrictMode is thrown as a warning when using react-transition-group React Transition Group:如何将 ref 传递给映射的组件以避免警告:在 StrictMode 中不推荐使用 findDOMNode - React Transition Group: How to pass ref to mapped component to avoid Warning: findDOMNode is deprecated in StrictMode OverlayTrigger - findDOMNode 在 StrictMode 中被弃用 - OverlayTrigger - findDOMNode is deprecated in StrictMode findDOMNode 在 StrictMode 中被弃用 - findDOMNode is deprecated in StrictMode 警告:在 StrictMode 中不推荐使用 findDOMNode。 findDOMNode 传递了一个在 StrictMode 内的 Transition 实例 - Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode 带有 Transition 的对话框抛出 JS 警告“在 StrictMode 中不推荐使用 findDOMNode” - Dialog with Transition throwing JS warning “findDOMNode is deprecated in StrictMode”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM