const [test, setTest] = useState("");
useEffect(() => {
setTest("NOT EMPTY");
if(test) {
console.log(test)
} else {
console.log("ITS EMPTY")
}
}, [])
this is a simplified form of my code when I save it and the page automatically refreshes because of nodemon output is : NOT EMPTY
but when i refresh the page or hit f5 output is : EMPTY