Skip to content

When passing an imported $state as Object.values() to an external component reactivity does not work #13212

Closed
@mrh1997

Description

@mrh1997

Describe the bug

When I import a $state({...}) and pass it via Object.values(...) as attribute to a sub-component reactivity does not work:

<script>
	import { obj } from "./Data.svelte.js";
       ...
</script>

...
<Component lst={Object.values(obj)}/>

The Problem does not occur when using Object.values(obj) locally or when creating a derived rune (let derivedObj = $derived(obj)) and pass this one to the sub-component.

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACq1SsU7DMBD9lZNhSKWooYiFkFZClJUiQCyEwU0dmjS1I_tSqCz_O-emNKFdGJiiuzy_9-7uWZYXlTAsfrNM8rVgMbutaxYy3Na-MBtRoaDaqEZnvpOYTBc1TlKZYrGulUa4U_SVQiLkWq0hZcPo0Bq2DCm76T2woOYluA4-5cj3yGFpWjDB80ZmWCgJWtQVz8SjVnUwAOv_pTiblyLDITem-JABMYZgeXwdwjweXYSQxaORG-xkXSqTqPMtk3mDSLRKZlWRrca2x-8IAU9tDa-8aoQBlZNLEkiZJ2oft0TLq4kWnExuCtz2cDCd3T_Dw-wFPpVexUlEQIJ3m6oMju1-gs1OxU8wcNERb37E6-nMD589I8wSTmmAG6DS-eGTRbGZtBuzh17UNm3kCRzdd60WpCUWLEbdCBce4nCw_NdQVMIfmOajA4_hvKadmsDf4dcJ9tY97P-89mLUuS1N36n42iXQm_QZJIMGOYqAkjPyybmkyJxKvLtvssT2IikDAAA=

Logs

No response

System Info

reproduced in Preview

Severity

annoyance

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions