Skip to content
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

Docs suggest { context: TAllContext } in loaderDeps but it is not #1216

Closed
lukaskoeller opened this issue Feb 23, 2024 · 1 comment
Closed
Labels
documentation Everything documentation related

Comments

@lukaskoeller
Copy link

Describe the bug

The docs for loaderDeps indicate that you can access the context (besides e.g. search) to create a dependency record. Though, when I do that using "@tanstack/react-router": "^1.16.6", it is not found.

I assume it is either missing in the code or the docs are not up to date. If latter is the case, I wonder why context was removed, since I use it in loader to inject fetch arguments.

No context in loaderDeps, only search

Your Example Website or App

https://stackblitz.com/edit/github-swqukk?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Go to main.tsx
  2. Go to line 34
  3. See the underlined context error
  4. See the undefined value in the console

Expected behavior

I expect context from the loaderDeps to be defined.

Screenshots or Videos

Screenshot 2024-02-23 at 10 41 45

Platform

  • OS: macOS Sonoma 14.3.1
  • Browser: Chrome
  • Version: 1.16.6

Additional context

No response

@lukaskoeller lukaskoeller changed the title Docs suggest { context: TAllContext } in loaderDeps but it is not Docs suggest { context: TAllContext } in loaderDeps but it is not Feb 23, 2024
@SeanCassiere
Copy link
Member

Closed this with #2091.

I've written up an explanation in PR on the availability of context and location in loaderDeps.

@SeanCassiere SeanCassiere added the documentation Everything documentation related label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Everything documentation related
Projects
None yet
Development

No branches or pull requests

2 participants