Reactjs Setting State Inside A Useeffect Function Is Losing State

Reactjs Setting State Inside A Useeffect Function Is Losing State