简体   繁体   English

尝试添加 React 代码段但出现错误。 useRef 不是 function

[英]Trying to add a React snippit but getting error. useRef is not a function

I'm trying to add a snippet to stackoverflow but I keep getting this error:我正在尝试向 stackoverflow 添加一个片段,但我不断收到此错误:

react-dom.production.min.js:137 Uncaught TypeError: useRef is not a function react-dom.production.min.js:137 Uncaught TypeError: useRef is not a function

在此处输入图像描述

I'm doing everything it suggests but I keep getting the error for react dom.我正在做它建议的一切,但我不断收到 react dom 的错误。

You need to update the scripts to the latest version 16.8.4 .您需要将脚本更新到最新版本16.8.4

Source (See last example)来源(见最后一个例子)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM