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

Preserve the name type on route.matched and route.matches #325

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

pleek91
Copy link
Contributor

@pleek91 pleek91 commented Nov 23, 2024

Description

Updated the Route type to accept another generic that is the union of all names in the route's definition. That way route.matched.name and route.matches[number].name reflect the actual route.

I need to do some more testing but I believe this will solve #299 because now this snippet no longer has a type error

image

Copy link

netlify bot commented Nov 23, 2024

Deploy Preview for kitbag-router ready!

Name Link
🔨 Latest commit d97316d
🔍 Latest deploy log https://app.netlify.com/sites/kitbag-router/deploys/674397ac341316000832adf8
😎 Deploy Preview https://deploy-preview-325--kitbag-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/types/route.ts Outdated Show resolved Hide resolved
@pleek91 pleek91 merged commit 6f49888 into main Nov 25, 2024
6 checks passed
@pleek91 pleek91 deleted the matches-types branch November 25, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants