Replies: 2 comments
-
I just noticed I was missing
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having some issues getting the "scope" of a nested route to update when the URL of the route changes when using the
$url
helper.Pre-requisite:
My current

Pages
structure is setup like this:So the general idea I am going for, is that I have a set of "Categories" which each contain a set of "Types". When viewing
/[category]
route, the idea is that all of thetypes
would be represented astabs
. When you click on a "Type" tab, you would then be presented with a number of entries for that combination of "Category" and "Type". You could then freely switch between tabs within the category to see all of the different entries.Here is my
_layout.svelte
for [category]In
npm run dev
navigating to the/beef
route generates the list oftypes
as expected. And manually updating the URL also works as expectedUpon clicking one of the
types
, the URL updates, and I also get the expected display of my nested route.Here is my
_layout.svelte
for the [category]/[type] routeAnd here is the
index.js
The tabs remain on the page (as expected) and everything seems to be ok - However, if I click on a different
type
, the URL updates, but my "scope" does not update, and therefore, thetype
value in myindex.js
does not reflect the updated value. Only upon refresh of the browser to I see the updatedtype
value I expect.I hope this makes sense, and I am sure I am missing something very minor! Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions