Below is my code
function App() {
const [isImportant, setIsImportant] = useState("Yes")
function handleClick() {
setIsImportant("No")
}
return (
<div className="state">
<h1 className="state--title">Is state important to know?</h1>
<div className="state--value" onClick ={setIsImportant("No")} >
{isImportant}
</div>
</div>
)
}

However I get the error which says 'Uncaught Error: Too many re-renders. React limits the number of renders to prevent an infinite loop.'
If someone can explain why the error is happening it would be grateful!!