-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure hook subscription failures do not reset isLoading state #4364
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e5a9962:
|
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
That won't prevent a refetch though, just display |
@phryneas true! This will still fetch twice. I tried to scope this change to only avoid the infinite loop where The My specific problem is working with endpoints that can fail (often 401 or 404). The app has a rather deep tree and multiple parts of it need the same data. I assumed I could rely on the return (args, {refetchOnError = true, ...options}) => {
const {isError} = endpoint.useQueryState(args, options)
return useHook(args, {
...options,
skip: !!options.skip || (isError && !refetchOnError),
})
} EDIT: adds more specific response and clarity to what is being aimed for. |
Co-authored-by: Lenz Weber-Tronic <mail@lenzw.de>
This PR aims to resolve an issue where the isLoading state of a parent component was being reset by a child component if the child component was rendered conditionally.
Relates to: #1349 (reply in thread)