Closed Brentlok closed 1 year ago
For anyone having the same issue, I've came up with that simple function
import { afterUpdate } from "svelte";
export const watchLinks = () => afterUpdate(() => window.spa.scan());
Just put this in between your script tags in svelte components, I guess this idea can be used in other frameworks (React, Vue, etc.)
I've wanted to use astro-spa with svelte (@astrojs/svelte), but I've found out that astro-spa doesn't really seem like working with it.
Links created inside astro components/pages works fine but in svelte components they don't.
Something like this fixes pure navigation problem:
But I don't really like putting that line in every place I want to use link + prefetching doesn't work even if I manually set something like this:
Any ideas how I can fix that? Or I'm getting something wrong and astro-spa doesn't support external UI frameworks.
Versions:
config: