-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
docs: document typed params in page props #15284
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
docs: document typed params in page props #15284
Conversation
|
bebbcd5 to
c48bd79
Compare
dummdidumm
left a comment
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.
thank you
Closes #14066
This PR documents the typed
paramsprop that was introduced in #13999.Previously, the routing docs showed how to access typed
datain+page.svelteviaPageProps, but did not mention thatparamsis also available and typed based on the route parameters. This made the feature difficult to discover for users working with parameterised routes.This change:
+page.svelterouting example to destructureparamsfrom$props()paramsin a[slug]route$typessection to explain thatPagePropsincludes typed route parametersPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits