I'm using for the first time svelte for a portfolio and coming from React I must say it's really fun and easy to use !
But recently i had issues using AOS with svelte kit. Mostly when I'm going from a page to another using href the animations won't load. But when i'm refreshing the page (with cmd+R) it works again.
I'm using this method in my __layout.svelte. Putting it in onMount or not doesn't change anything.
onMount(() => {
AOS.init();
});
Then in another page i'm using AOS like below
<h1
data-aos="slide-right"
data-aos-duration="1000"
>
Allianz France
</h1>
And to go from page to page i'm using
<a
href="allianz"
sveltekit:reload
out:fly|local={{ x: -200, duration: 1000, delay: 300 }}
in:fly={{ x: 200, duration: 1000, delay: 1300 }}
id="allianz"
>
Using sveltekit:reload does not change anything.
package.json
"aos": "^3.0.0-beta.6"