import { useState, useEffect } from "react"
export default function App() {
const [a, setA] = useState("");
useEffect(() => {
console.log(a);
// This should give a warning
}, []);
if(a) {
// This should give an error
const foo = useState()
}
return (
<div className="App">
<h1>Hello CodeSandbox</h1>
<h2>Start editing to see some magic happen!</h2>
</div>
);
}
To enter the code editing mode, press Enter. To exit the edit mode, press Escape
You are editing the code. To exit the edit mode, press Escape