Skip to content

The type of the "search" option in useNavigate is incorrect. #5203

@eavidy

Description

@eavidy

Which project does this relate to?

Router

Describe the bug

import { NavigateOptions, useNavigate } from "@tanstack/react-router";

function Page() {
	const navigate = useNavigate();

	const option: NavigateOptions = { search: (prev: any) => prev }; // no type error

	navigate(option); // no type error
	navigate({ search: (prev: any) => prev }); //type error
}

Your Example Website or App

https://stackblitz.com/edit/github-9byjdyh7-rl6x81qz?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

Paste the code above in VSCode

Expected behavior

No type errors

Screenshots or Videos

Image

Platform

  • Router / Start Version: [e.g. 1.132.2]
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

No response

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