React中使用antd-mobile组件库中的跑马灯组件报错严格模式问题
A string ref, "slider", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mod
使用antd-mobile的跑马灯组件报错
index.js:1 Warning: A string ref, "slider", has been found within a strict mode tree.
String refs are a source of potential bugs and should be avoided.
We recommend using useRef() or createRef() instead.
Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref
index.js:1 Warning: A string ref, "frame", has been found within a strict mode tree.
String refs are a source of potential bugs and should be avoided.
We recommend using useRef() or createRef() instead.
Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref
根据提示我们找到:React严格模式
根据以上信息,找到项目src目录中的index.js,删除掉该 <React.StrictMode>
标签即可。