I have this component:
import React, { useState, useEffect } from \"react\";
import ReactDOM from \"react-dom\";
function App() {
const [count, setCount]
You may get same error when using jest. So to fix the error I had to update react-test-renderer to have the same version as react and react-dom
yarn add -D react-test-renderer@next
Or
npm i react-test-renderer@next
All react, react-dom and react-test-renderer should contain same version
"react": "^16.7.0-alpha.0",
"react-dom": "^16.7.0-alpha.0",
"react-test-renderer": "^16.7.0-alpha.0"