You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am very new at svelte. How can I change table data reactivly. When I try to assign variable to data I get error "State referenced in its own scope will never update. Did you mean to reference it inside a closure?"
The text was updated successfully, but these errors were encountered:
let{ data }=$props();letrows=$derived(data.rows)consttable=newDataTable({/* settings */})table.baseRows=rows;
Instead, you can do something like this:
let{data}=$props();consttable=newDataTable({/* settings */})$effect(()=>{table.baseRows=data.rows;// or whatever you're returning the rows from the server as});
I am very new at svelte. How can I change table data reactivly. When I try to assign variable to data I get error "State referenced in its own scope will never update. Did you mean to reference it inside a closure?"
The text was updated successfully, but these errors were encountered: