Open mcharnet opened 5 hours ago
This is caused by a breaking change in Svelte 5: using a reactive variable in a function definition does not trigger effects unless the function is called. Because of this, migrating layers by changing $: render = ...
to let render = $derived(...)
doesn't work.
I'm working on an update to the library that will address this, but it's not ready yet. In the meantime, there are a few possible workarounds:
$derived.by
as shown here. autoplay
prop. This will cause the canvas to re-render on every frame, even when nothing has changed.Thank you for your quick reply !
Nice to read that you're on an update, and looking forward to seeing this ! In the meantime, I think I'll keep the Svelte 4 syntax for the render functions.
Hello,
Thank you for this great library !
It was working great with svelte 4, but when I tried to bump, I encountered issues with reactivity. Indeed, the Layer's
render
function seems to be incompatible with the runes and not been re-evaluated if it contains a reactive variable.Did you plan to make the library compatible ?
Thanks !