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
问题追溯 index.js中的
ReactDOM.render(
<React.StrictMode>
<Router />
</React.StrictMode>,
document.getElementById('root')
);
<React.StrictMode> 这里出了问题 。
这是一个严格模式。
StrictMode
目前有助于:
由于新增的对象式refs很大程度上作为字符串ref的替换,因此strict mode现在对字符串ref的用法发出警告。