-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
docs: explain why route id can be null #13581
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
Conversation
You've edited the generated file. You need to instead update |
packages/kit/types/index.d.ts
Outdated
@@ -972,7 +972,7 @@ declare module '@sveltejs/kit' { | |||
*/ | |||
route: { | |||
/** | |||
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]` | |||
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is null when the router fails to match a route. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can tweak this to be a bit more concise and avoid the word "fails" which might indicate some error occurred rather than expected behavior
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is null when the router fails to match a route. | |
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. The ID is `null` when no route is matched. |
This reverts commit be452ea.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accepted ben's suggestion and applied the changes to public.d.ts
. thanks!
I couldn't get symlinks to work so I'm just winging it :/
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits