Search code examples
reactjsstack-overflow

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:

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

enter image description here

I'm doing everything it suggests but I keep getting the error for react dom.


Solution

  • You need to update the scripts to the latest version 16.8.4.

    Source (See last example)