I know that TypeScript passes objects by reference and that there is no clear best practice to go around it to get a deep copy, but i find it difficult to work with this, especially when working in a theme.
I just had the case with a component that has an array of object and passes those to child components. Each child component updates the single object passed as input. Problem: I wasn't the one who programmed it so i had no idea that the child component modified the values directly. And even if i was, i'm pretty sure i wouldn't have remembered six months later.
Is there a clear best practice to deal with this?