Closed as duplicate of#15877
Closed as duplicate of#15877
Description
Describe the problem
when i create an object and want to push it to two different arrays, like a flat and 2d array it loses the reference.
or when creating components, where there are items
and _items
i need to use the last element of the array because it's copied.
i can live with it, because there are workarounds, but with complex data it is easier to get lost.
here's a playground with latter example, try typing in the inputs
Describe the proposed solution
if it is somehow possible to retain the same object reference when putting it in a $state()
it would be delightful
Importance
would make my life easier
Metadata
Metadata
Assignees
Labels
No labels