Javascript Why Is My Conditional Statement Not Working As Expected In Useeffect Hook Stack

Javascript Why Is My Conditional Statement Not Working As Expected In Useeffect Hook Stack