Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Svelte 5 bind value is getting more complex

$
0
0

I migrate my progect to svelte 5 and start using the power of runes but the code is buggy because the bind is not working anymore and i had to add some extra line of code. Here and example before and after the migration. I personally think in svelte 4 was way much simpler. Do you think i can make it better?

Before:

export let data: PageData;<Player bind:data={data.news} /><Actions bind:data={data.news} />

After:

interface Props {   data: PageData;}let { data }: Props = $props();let news: Data = $state(data.news);page.subscribe(() => (news = data.news));<Player bind:data={data.news} /><Actions bind:data={data.news} />

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>