Ajit Mishra
03/30/2025, 1:34 PMdisableControl. This is set to true because the loginOptionsLoading variable is true. The || (OR) operator checks for any true value from left to right and returns true and loginOptionsLoading is returning it as true . loginOptionsLoading gets data from the useFetchLoginOptions hook. useFetchLoginOptions makes an API request to fetch fetchLoginOptions. Here useFetchLoginOptions parameter for email is undefined
I added logs to check if an API request is made during the initial loading. However, I found that fetchLoginOptions does not make an API request when email = undefined is passed, but the useQuery hook still returns isLoading = true as a defult.
To solve this issue, TanStack recommends using the enabled parameter and setting its value to false. So, I added enabled = !!email to set it to false if email is undefined, but it is still not working as expected. I also tried returning a default value when email is undefined, but it is still not working.
Thank youPylon
03/30/2025, 1:34 PMOliver Ramsay
03/31/2025, 8:35 AMAjit Mishra
03/31/2025, 10:34 AMOliver Ramsay
03/31/2025, 10:49 AMOliver Ramsay
03/31/2025, 10:50 AMAjit Mishra
03/31/2025, 11:03 AMAjit Mishra
03/31/2025, 11:06 AMOliver Ramsay
03/31/2025, 3:11 PMAjit Mishra
03/31/2025, 7:04 PMGiorgi Bagdavadze
04/01/2025, 9:21 AMAjit Mishra
04/01/2025, 12:35 PM/user/login-options API is getting called because this useFetchLoginOptions hook was returning isLoading: loginOptionsLoading true which was making disableControl true and so forth I add enabled parameter in useQuery hook within useFetchLoginOptions but didn't work out.
I had some vite issue too so had to clean up the whole project and reinstall and after that this issue got fixed on version 0.1558.0.
I can still try to rollback to 0.1555.0 and will try to recreate this issue for you if you want.Ajit Mishra
04/01/2025, 12:38 PMGiorgi Bagdavadze
04/01/2025, 2:33 PMAjit Mishra
04/01/2025, 3:04 PM