ante react 警告 index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an

create-react-app 版本:3.4.1
ante 版本:4.0.4

引用ante的示例组件一直报警告,

index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Tabs 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
    in div (created by Tabs)
    in Tabs (created by Context.Consumer)
    in Tabs (at home/index.jsx:18)
    in div (at home/index.jsx:17)
    in Home (created by Context.Consumer)
    in Route (at App.js:14)
    in Switch (at App.js:13)
    in Router (created by HashRouter)
    in HashRouter (at App.js:11)
    in App (at src/index.js:9)
    in StrictMode (at src/index.js:8)

ante react 警告 index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an_第1张图片

经过开发者的issue回复,原来是把严格模式加入了版本改动中

ante react 警告 index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an_第2张图片

找到index.js 果然默认是严格模式,删除标签,关闭严格模式,警告自然消除了

ante react 警告 index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an_第3张图片

你可能感兴趣的:(ante react 警告 index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an)