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

ReactQuery: pageParams not inheriting initialPageParam type (always unknown) #1597

Open
vitorcamachoo opened this issue Aug 26, 2024 · 0 comments
Labels
tanstack-query TanStack Query related issue

Comments

@vitorcamachoo
Copy link

vitorcamachoo commented Aug 26, 2024

What are the steps to reproduce this issue?

  1. Generate react-query with infinite options to enable
  2. On react-query v5, initialPageParam is a required property so we pass it
  3. On the queryFn, the pageParams is not inheriting the type based on what we defined on initialPageParam. It is always considered unknown

What were you expecting to happen?

pageParams should inherit the type defined on initialPageParam

What versions are you using?

System:
    OS: macOS 14.4
    CPU: (11) arm64 Apple M3 Pro
    Memory: 3.34 GB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  npmPackages:
    @tanstack/react-query: 5.52.1 => 5.52.1 
    axios: 1.7.2 => 1.7.2 
    msw: 1.1.0 => 1.1.0 
    react: 18.2.0 => 18.2.0
    orval: 6.21.0 => 7.0.1

Note: I tried on the latest Orval version, but nothing changed regarding this issue.

@melloware melloware added the tanstack-query TanStack Query related issue label Aug 26, 2024
@melloware melloware changed the title pageParams not inheriting initialPageParam type (always unknown) ReactQuery: pageParams not inheriting initialPageParam type (always unknown) Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tanstack-query TanStack Query related issue
Projects
None yet
Development

No branches or pull requests

3 participants
@melloware @vitorcamachoo and others