-
-
Notifications
You must be signed in to change notification settings - Fork 745
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(react-router): ensure fetch abort works correctly even with pendingComponent #3181
base: main
Are you sure you want to change the base?
Conversation
…ngComponent Signed-off-by: leesb971204 <[email protected]>
View your CI Pipeline Execution ↗ for commit eeeaeda.
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/create-router
@tanstack/create-start
@tanstack/directive-functions-plugin
@tanstack/react-cross-context
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-with-query
@tanstack/router-cli
@tanstack/router-devtools
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/start
@tanstack/start-api-routes
@tanstack/start-config
@tanstack/start-client
@tanstack/start-plugin
@tanstack/start-router-manifest
@tanstack/start-server
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-handler
@tanstack/start-server-functions-server
@tanstack/start-server-functions-ssr
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
can you please add a test for this? |
…tly even with pendingComponent Signed-off-by: leesb971204 <[email protected]>
I have added and written the test cases as requested. Since this is my first attempt at writing test cases, I am unsure if they have been written correctly. I would greatly appreciate it if you could kindly review them and provide your feedback. For your reference, it seems that the code below needs to be placed at the very top of the file in my local environment for the test cases to work properly. Thank you so much in advance for your help! /**
* @vitest-environment jsdom
*/
import '@testing-library/jest-dom/vitest' |
I apologize for the misunderstanding earlier. To clarify the issue, when pendingMs is 0, the abort function operates correctly if there is no pendingComponent. However, if a pendingComponent is present, the abort function does not work as expected. I have made modifications to address this behavior. Considering that this might be the intended functionality, I believe it may be necessary to revise the title of the PR accordingly. |
this does not work with preloads. hover over a link, let the preload start. then click, wait for the pending component, navigate away. preload is not cancelled. |
2025-01-22.3.50.05.movIf the issue you mentioned about preload not working aligns with the behavior in the video, it seems unrelated to my work. I have reproduced this behavior in the latest main branch, and it does not appear to be a side effect of my changes. While I agree that preload(fetching posts in my video) should be aborted, the environment in which I worked had defaultPreload set to false, and I believe addressing this behavior should be treated as a separate issue. And I think hover action is related to cachedMatches not pendingMatches. Therefore, I think that the work regarding preload not functioning properly should be addressed in a new PR. What are your thoughts on this? |
…d on browser location changes Signed-off-by: leesb971204 <[email protected]>
fixes #3014