Skip to content

bug: onAppear fires even if a view has not yet appeared #7

@vladimirleonidovich

Description

@vladimirleonidovich

Steps To Reproduce

ScrollView {
  VStack {
    ForEach(0...1000, id: \.self) { number in
      Text("0")
        .onAppear {
          print(number.formatted()) // "1000" will be printed
        }
    }
  }
}

The same happens if you write something like this:

ScrollView {
  VStack {
    PaginatorForEachView(
      store: store.scope(state: \.paginator),
      action: { .child($0) }
    ) { product in
      CardView(of: product)
    }
  }
}

The current behavior

Because of the mentioned problem an infinite chain of http requests occurs in my app

The expected behavior

My app fires a request when the last view appears.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions