Having such a simple React App:
import React, { useState, useEffect, useRef } from "react";
import ReactDOM from "react-dom";
function App() {
const [inputValue, setInputValue] = useState("");
const count = useRef(0);
useEffect(() => {
count.current = count.current + 1;
});
return (
<>
<input
type="text"
//value={inputValue}
//onChange={(e) => setInputValue(e.target.value)}
/>
<h1>Render Count: {count.current}</h1>
</>
);
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
I'm getting en errors:
(0 , _react.useState) is not a function (0 , _react.useRef) is not a function
What Am I doing wrong?
reactandreact-domon yourpackage.json?