蚀刻的头像 ID: 25217450276

蚀刻

HelloWorld 社区成员

4314120577

文章1
个人网站0
加入社区2025

React报错之Function components cannot have string refs

总览当我们在一个函数组件中使用一个字符串作为<coderef</code时,会产生&34;Functioncomponentscannothavestringrefs&34;错误。为了解决该错误,使用<codeuseRef()</code钩子来得到一个可变的<cod