Describe the bug#
When query refetching happens, for example on window focus, error object is not cleared even though types say that when isLoading is set to true, error is always null. Screenshot attached
Your Example Website or App#
https://codesandbox.io/s/boring-paper-l7jf0?file=/src/use-subscription.tsx
Steps to reproduce#
Open the console and watch for variables being displayed, once you refocus back to the window both isLoading and error are displayed.
Expected behavior#
- remove the error when we go to loading state.
- change the types so that they reflect that you can have an error in loading state, too.
How often does this bug happen?#
Every time
Screenshots or Videos#

Platform#
- OS: [e.g. macOS, Windows, Linux, iOS, Android]
- Browser: [e.g. Chrome, Safari, Firefox, React Native]
- Version: [e.g. 91.1]
Additional context#
No response
:tada: This issue has been resolved in version 3.34.5 :tada:
The release is available on:
Your semantic-release bot :package::rocket: