Go Pro Sign Up Login
0 days 0 hrs 0 min 0 sec

Summer Sale

50% off Level Up Pro until you unsubscribe.
Get access to ALL 128 courses on Level Up Tutorials

This is your last chance to get Level Up Pro for $145/year.

or Learn More
Moon Moon

Buy Now and unlock this series

$

49

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

Glob Imports

Here we will look at gob imports, a feature from Vite. Using glob imports will give us a quick and easy way to import all of our posts within one folder at once.

Downloads

Become a pro to download code and videos

Comments

Brian

9 months ago

Is there a way to force the < Hello /> component to re-render on route change?

I know this is old but I'll answer anyway in case it helps someone new here...

According to vite in my console, the Hello component will not be reactive if Hello changes. Use <svelte:component this={Hello}/> if you want this reactivity.

So change: <Hello /> to: <svelte:component this={Hello} />

It will then re-render on route change.

Devang

7 months ago

Got the same vite warning as you. Replacing <Hello/> with <svelte:component this={Hello} /> does the trick.

Andy

10 months ago

Is anyone else having trouble with the slug? The approach explained in the video for programmatically creating the hrefs in the archive works if I am on one of the post detail pages, but not if I'm on the post index page. For example, on the post detail page, the link generated for the first post is "http://localhost:3000/posts/goodbye&quot; (which is correct), but on the index it is "http://localhost:3000/goodbye&quot; (which is not). Any idea what is going on?

Russ

11 months ago
User avatar

DumDumDev

about 1 year ago

Bingo Bango. Love that and need to start using it.

User avatar

Spenser

about 1 year ago

@Scott Thanks Scott. Actually in the very next lesson @lee gives the solution and as per usual with svelte its simple and elegant. So anyone stuck on my issue just peak the comments in the next lesson.

User avatar

Scott

about 1 year ago

@Spenser Very odd. I'll fire mine up and give it a look.

User avatar

Edwin

about 1 year ago

I also have the same question as Spenser, It doesn't re-render the page again, it stays the same.

User avatar

Spenser

about 1 year ago

Is there a way to force the < Hello /> component to re-render on route change? When I click the 'Hello' link I go to the Hello page but then from there if I click my 'Goodbye' link the route changes and it does even go and get the correct .md file and everything but the content in the < Hello /> component stays the same unless I reload the page. Any thoughts?

Want to join the conversation?

Become a Pro member today!