I'm new here to React. So the code here updates the value of height(whenever the screen size changes) after every refresh. Really confused as to why is it happenning since setHeight is not being used to update the value of height.
import React, { useState } from "react";
import "./styles.css";
export default function App() {
const [height, setHeight] = useState(window.innerHeight);
return (
<div className="App">
<h1>
{height}
</h1>
</div>
);
}