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

A from union should result in a intersection of relative to paths #3011

Open
nstepien opened this issue Dec 14, 2024 · 0 comments
Open

A from union should result in a intersection of relative to paths #3011

nstepien opened this issue Dec 14, 2024 · 0 comments
Labels
types Changes to the typescript types

Comments

@nstepien
Copy link
Contributor

nstepien commented Dec 14, 2024

Which project does this relate to?

Router

Describe the bug

When from is a union of different paths, to allows a union of relative paths for from instead of an intersection, resulting in invalid links.

Your Example Website or App

https://stackblitz.com/edit/github-dj5qylfv?file=src%2FPage.tsx,src%2Froutes%2F__root.tsx,src%2Froutes%2Fposts%2Fpost%2F%24postId.tsx,src%2Froutes%2Fusers%2Fuser%2F%24userId.tsx

Steps to Reproduce the Bug or Issue

  1. Use a from that is an union of different valid paths
  2. Write a relative to

Expected behavior

to should only allow relative paths that are valid for all from paths.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: 131.0.6778.140

Additional context

I wonder if this can be done in TS 🤔

@schiller-manuel schiller-manuel added the types Changes to the typescript types label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Changes to the typescript types
Projects
None yet
Development

No branches or pull requests

2 participants