gpt4 book ai didi

reactjs - 警告 : findDOMNode is deprecated in StrictMode, react-redux-notify

转载 作者:行者123 更新时间:2023-12-03 18:40:16 24 4
gpt4 key购买 nike

我在使用 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)
如何纠正这个?

最佳答案

index.js
移除 包装器

ReactDOM.render(                                                                              <React.StrictMode>
<React.StrictMode> //remove this
<App />
<React.StrictMode/> //remove this as well.
,
document.getElementById('root')
)
ReactDOM.render(
<App />,
document.getElementById('root')
)

关于reactjs - 警告 : findDOMNode is deprecated in StrictMode, react-redux-notify,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60802216/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com