'expo react native on ios setState is not working

here in this code none of the state inside if condition is working on ios but its working on android phones. I am using expo go app for working ios/android.

ProfileService.getDashboardInfo(res,0).then(res=>{

   if(res?.success){
      setloading(false)
      setdashboardInfo(res?.data)
      setCount(res?.data?.pendingJobs)
   }
    
})

any kind of suggestions will be appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source