Say for example we have a useState hook like so:
const [isImportant, setIsImportant] = React.useState("Yes")
How come setIsImportant() cannot be directly referenced to set a value. For example, setIsImportant cannot be directly called using onClick():
onClick={(setIsImportant("no")}
Instead it needs to be wrapped in another function:
onClick={() => setIsImportant("no")}
What is the difference between these two lines of code? Shouldn't they do the same thing?