function LoginComponent(){
const [clicked, setClicked] = useState(false)
function handleClick(){
console.log('before', clicked)
setClicked(true)
console.log('after', clicked)
}
return(
<a onClick={handleClick}>
random text
</a>
)
}
When I run this, the console outputs before false after false. Why is this? I have no clue why this behavior is like this.