Complete the code to define a dynamic route parameter in SvelteKit.
<script>
export let [1];
</script>In SvelteKit, dynamic route parameters are passed as props with the same name as the parameter. Here, id matches the dynamic segment in the filename.
Complete the code to display the dynamic parameter value inside the component.
<script>
export let id;
</script>
<p>Item ID: [1]</p>In Svelte, to display a variable's value in HTML, you wrap it in curly braces like {id}.
Fix the error in the route filename to correctly capture a dynamic parameter.
src/routes/[1].svelteSvelteKit uses square brackets around the filename to define dynamic route parameters, like [id].svelte.
Fill both blanks to create a nested dynamic route and access its parameters.
<script> export let [1]; export let [2]; </script>
For nested dynamic routes like [category]/[slug].svelte, you export both parameters category and slug.
Fill all three blanks to create a dynamic route and display all parameters in the component.
<script> export let [1]; export let [2]; export let [3]; </script> <p>Category: {category}</p> <p>Post: {post}</p> <p>Comment ID: {commentId}</p>
For a route like [category]/[post]/[commentId].svelte, export all three parameters to use them inside the component.