Useeffect Function Not Working As Expected In React

Useeffect Function Not Working As Expected In React