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

Effects no longer work with reactive objects when using runes

$
0
0

In Svelte 4, the effect below would fire every time user or pass props from it changed

let data = {    user,    pass,};$: data && clearErrors()

In Svelte 5 the equivalent code with runes would be:

let data = $state({    user: '',    pass: ''})$effect(() => data && clearErrors());

But now the effect does not run when user or pass props are changed. Can someone explain to me why this happens?


Viewing all articles
Browse latest Browse all 1759

Latest Images

Trending Articles



Latest Images

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