Skip to content

Types require __TSR_index in link states #3130

Closed

Description

@nstepien

Which project does this relate to?

Router

Describe the bug

Types now require state in links to have an internal __TSR_index property.

Your Example Website or App

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

Steps to Reproduce the Bug or Issue

  1. Have a link with state: { customState: ... }
  • for example:
    linkOptions({ state: { test: true } });
  1. Notice the type issue:
    Type '{ test: true; }' is not assignable to type 'true | NonNullableUpdater<HistoryState> | undefined'.
      Property '__TSR_index' is missing in type '{ test: true; }' but required in type 'HistoryState'.
    

Expected behavior

No type issues, I shouldn't have to worry about internal properties.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: 131.0.6778.265

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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