SwiftUI List with Section and ForEach loads all rows at once

Hello, coming from SO (https://stackoverflow.com/questions/71806868/swiftui-list-with-section-and-swipe-actions-loads-all-rows-at-once) I can't find any related post here. The issue: If you are using a ForEach inside a Section all rows are loaded at once. It seems like a bug or I misunderstood how to use them together.

NOTE: I also posted a temporary workaround to mock a section in this SO thread.

Here is the code snippet from SO:

struct Item: Identifiable {
    var id = UUID()
    var name: String
}

struct Row: View {

    var item: Item
    static var counter = 0

    init(item: Item) {
        self.item = item

        Row.counter += 1
        print(Row.counter)
    }

    var body: some View {
        Text(item.name)
    }
}

struct ContentView: View {

    @State var items = (1...1000).map { Item(name: "Item \($0)") }

    var body: some View {
        List {
            ForEach(items) {
                Row(item: $0)
                    .swipeActions(edge: .leading) {
                        Button("Action", action: {})
                    }
            }
        }
    }
}

I filed a feedback, FB11280425, about this awful behavior on 8/16/22. Still no response from Apple and the problem persists in the latest Xcode 14.1/iOS 16.1 betas.

Here's the sample project I created for it: https://github.com/gcox/SwiftUIBugs/tree/main/SwiftUI_ForEach_Behavior

SwiftUI List with Section and ForEach loads all rows at once
 
 
Q