0
0
Svelteframework~10 mins

Route groups in Svelte - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a route group folder named __api__ in SvelteKit.

Svelte
src/routes/[1]/users/+page.svelte
Drag options to blanks, or click blank then click option'
A(api)
B[api]
C<api>
D{api}
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets or curly braces instead of parentheses.
Naming the folder without any special characters.
2fill in blank
medium

Complete the code to import a component from a route group folder named (admin).

Svelte
import AdminPanel from '$routes/[1]/dashboard/+page.svelte';
Drag options to blanks, or click blank then click option'
A(admin)
Badmin
C[admin]
D{admin}
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the parentheses in the import path.
Using square brackets or curly braces instead of parentheses.
3fill in blank
hard

Fix the error in the route group folder name to correctly group routes without changing the URL.

Svelte
src/routes/[1]/profile/+page.svelte
Drag options to blanks, or click blank then click option'
Aprofile-group
B[profile-group]
C(profile-group)
D{profile-group}
Attempts:
3 left
💡 Hint
Common Mistakes
Using dashes without parentheses which changes the URL.
Using square brackets or curly braces instead of parentheses.
4fill in blank
hard

Fill both blanks to create a route group folder and a nested route inside it.

Svelte
src/routes/[1]/[2]/+page.svelte
Drag options to blanks, or click blank then click option'
A(dashboard)
Bsettings
Cprofile
D[settings]
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets for the nested route folder.
Not wrapping the group folder in parentheses.
5fill in blank
hard

Fill all three blanks to create a route group, a nested folder, and a page component inside it.

Svelte
src/routes/[1]/[2]/[3]/+page.svelte
Drag options to blanks, or click blank then click option'
A(user)
Bprofile
Cedit
D[edit]
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets for the last folder.
Not wrapping the group folder in parentheses.