I've been trying to console.log this code to print "reviewer" however it's not showing up. I have it in a functional component. What could be wrong? I'm getting "Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:"
const testfc = () => {
console.log('tesing testing 123') //only this line prints
const [currentRole, setCurrentRole] = React.useState('reviewer')
React.useEffect(() => console.log(currentRole), [currentRole])
return <></>
}
testfc()
I fixed the return but still getting an error. The same one.