Svelte4 to Svelte5 Upgrade Reactivity #12501
-
|
Hi There, I'm in a process of rewriting my svelte4 codebase to svelte5 and I've this svelte Data Grid component(complex component removed other stuffs). I'm receiving columns for the grid as props and Added an additional column to show filter menu popup for each Column as follows then I rendered it as My FilterPopUp component is as follows I need to show the filterpopup when clicks on the filter button, This was works in svelte4, but I don't have any idea about how to make it works on svelte5 since the reactivity changed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
You are messing with props that are not Would either store the additional column data separately (e.g. in a map) or create a separate state variable, e.g. const extendedColumns = $state(columns.map(...));(If |
Beta Was this translation helpful? Give feedback.
You are messing with props that are not
$bindable, would not recommend that. Such properties are not deeply reactive.Would either store the additional column data separately (e.g. in a map) or create a separate state variable, e.g.
(If
columnscan change during the life of the component, you may need to combine this with$derivedor use an$effect.)