docs: remove the invalid `context` and `location` arguments from being shown as available in the `loaderDeps` #2091
main fromrefs/pull/2091/head·merged by SeanCassiere We haven't had the context and location arguments present as loaderDeps options, so this corrects this error in Router's documentation.
The reason we don't have location as an argument of loaderDeps is quite simple. If the location changes, the loader would anyways have to be refired (or retrieved from a cache using something like Query). The scenario in which this wouldn't be the case, is if you wanted to prevent this from happening when search params change. This is why only search is provided as its own argument.
The reason we don't have context as an argument of loaderDeps is because, when the root context has been changed, the user is expected to call router.invalidate(). This invalidate call discards all cached data and re-evaluates the entire route-tree. As such, having context as an argument in loaderDeps, makes no sense, since it wouldn't actually contribute anything towards the actual loaderDeps functionality.
- 1
commit:
507c608pnpm add https://pkg.pr.new/@tanstack/history@2091pnpm add https://pkg.pr.new/@tanstack/react-cross-context@2091pnpm add https://pkg.pr.new/@tanstack/react-router@2091pnpm add https://pkg.pr.new/@tanstack/react-router-with-query@2091pnpm add https://pkg.pr.new/@tanstack/router-cli@2091pnpm add https://pkg.pr.new/@tanstack/router-devtools@2091pnpm add https://pkg.pr.new/@tanstack/router-generator@2091pnpm add https://pkg.pr.new/@tanstack/router-plugin@2091pnpm add https://pkg.pr.new/@tanstack/router-vite-plugin@2091pnpm add https://pkg.pr.new/@tanstack/start@2091pnpm add https://pkg.pr.new/@tanstack/start-vite-plugin@2091Open in Stackblitz
More templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-file-based-codesplitting
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- tanstack-router-react-example-scroll-restoration
- tanstack-router-example-react-start-basic
- tanstack-router-example-react-start-basic-counter
- tanstack-router-example-react-start-basic-react-query
- tanstack-router-example-react-start-basic-rsc
- tanstack-router-example-react-start-trello-trellaux
- tanstack-router-example-react-start-basic-trellaux
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
SeanCassiere merged this2423d02
SeanCassiere closed this
@SeanCassiere is the loader intended to be fired when any property of
locationchanges? (I assume the whole object is replaced on navigate.)I noticed the route loader did not appear to fire when only
location.hashwas changed, so I'm not sure if I missed something or if that's a bug.@SeanCassiere is the loader intended to be fired when any property of
locationchanges? (I assume the whole object is replaced on navigate.)I noticed the route loader did not appear to fire when only
location.hashwas changed, so I'm not sure if I missed something or if that's a bug.Please open a new issue for this with a reproduction. This is sounding like a bug, but I can't be sure till someone investigates.
Sign in to join this conversation.
☁️ Nx Cloud Report#
CI is running/has finished running commands for commit 507c608d313fd1f974fc444261886b918ad476c6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 2 targets
nx run-many --target=build --exclude=examples/**nx affected --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build --parallel=3Sent with 💌 from NxCloud.