Skip to content

search prop on <Link /> is inferring the types for path params instead of the search query params #730

@SeanCassiere

Description

@SeanCassiere

Describe the bug

When using the component, the search prop is pulling the wrong types.

Instead of inferring the types for the search query parameter based on the route, it instead is pulling out the path params from the global context.

This bug is present only at the type-level, the actual runtime code works just fine.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-3uax76?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Go to the Stackblitz example.
  2. View lines 424 - 432.

Expected behavior

As a user, I expect to get the Typescript typings on the search prop for the route I'm going to.

Screenshots or Videos

image image

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 116

Additional context

Using 0.0.1-beta.190.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions