Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of CSSMotion 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项目中的报错-2020/09/30

问题追溯  index.js中的

ReactDOM.render(

  <React.StrictMode>

      <Router />

  </React.StrictMode>,

  document.getElementById('root')

);

<React.StrictMode>   这里出了问题 。

这是一个严格模式。

StrictMode目前有助于:

由于新增的对象式refs很大程度上作为字符串ref的替换,因此strict mode现在对字符串ref的用法发出警告。

 

相关文章:

猜你喜欢
  • 2021-09-01
相关资源
相似解决方案