Unexpected memory leak in SwiftUI when using @State and @Binding with List
I'm working on a personal project and I'm trying to debug I'm having a hard time understanding I'm facing an unexpected memory leak in my SwiftUI application when utilizing `@State` and `@Binding` with a `List`. The app's performance noticeably degrades after navigating back and forth between views that use these properties extensively. Here's an example of how I'm currently managing state within my views: ```swift struct ParentView: View { @State private var items: [String] = ["Item 1", "Item 2", "Item 3"] var body: some View { NavigationView { List(items, id: \.self) { item in NavigationLink(destination: DetailView(item: item, items: $items)) { Text(item) } } } } } struct DetailView: View { var item: String @Binding var items: [String] var body: some View { VStack { Text(item) Button("Remove Item") { if let index = items.firstIndex(of: item) { items.remove(at: index) } } } } } ``` While navigating back to `ParentView`, I've noticed that the memory usage keeps increasing, and using Instruments shows that there are strong reference cycles that I can't seem to resolve. I’ve tried using `weak` references in various places, but the leaks persist. I also attempted to replace `@Binding` with `@State` in `DetailView`, thinking that it might reduce the memory footprint, but that resulted in a crash because I'm trying to modify the `items` array from a non-@State context. Is there a best practice for managing state in SwiftUI when working with nested views to avoid this kind of memory leak? I would appreciate any insights into potential pitfalls or solutions that could help optimize memory usage in this case. I appreciate any insights! This is part of a larger REST API I'm building. I'm using Swift 3.10 in this project.