You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason for this is because checking both isError and isLoading does not actually guarantee that the data will be available. However, after isError and isPending are both checked to be false, typescript will actually narrow the type of the query data so that a check for undefined is no longer required.
Some components still use isLoading to check query status, this should be changed to isPending, and any remaining checks for the data being undefined should be removed.
The text was updated successfully, but these errors were encountered:
Tanstack Query official docs recommend using isPending for checking query status, rather than isLoading (https://tanstack.com/query/latest/docs/framework/react/guides/queries).
The reason for this is because checking both isError and isLoading does not actually guarantee that the data will be available. However, after isError and isPending are both checked to be false, typescript will actually narrow the type of the query data so that a check for undefined is no longer required.
Some components still use isLoading to check query status, this should be changed to isPending, and any remaining checks for the data being undefined should be removed.
The text was updated successfully, but these errors were encountered: