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

Types Issues while using Router with Query #3520

Open
yogeshbabu opened this issue Feb 22, 2025 · 1 comment
Open

Types Issues while using Router with Query #3520

yogeshbabu opened this issue Feb 22, 2025 · 1 comment

Comments

@yogeshbabu
Copy link

Which project does this relate to?

Start

Describe the bug

There is an Type error when i try to use react-router-with-query. I followed the template and searched all documents for a solution or implementation, nothing exists. There are few other ones, but this has more bad ripple effect

router.tsx ( with query client )
Image

Type Error:
Argument of type 'Router<RootRoute<undefined, {}, AnyContext, AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>, ... 4 more ..., Record<...>>' is not assignable to parameter of type 'never'.

Tried all possible combinations but only way to skip is use "any" as type but then it is not the right solution and also throws type error in other parts of router use.

Your Example Website or App

localhost

Steps to Reproduce the Bug or Issue

Use https://github.com/tanstack/router/tree/main/examples/react/start-basic-react-query template

Expected behavior

Create Router without any type issues

Screenshots or Videos

No response

Platform

  • OS: [Windows, Linux]
  • Browser: [Chrome, Edge, Firefox]

Additional context

No response

@schiller-manuel
Copy link
Contributor

do you have set the router context correctly in root route?

export const Route = createRootRouteWithContext<{
queryClient: QueryClient
}>()({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants