I have a common function for useeffect to handle ajax calls commonly as below: please ignore the other stuffs just focus on useEffect and useState only I want state differen