Skip to content

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

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.

Activity

  1. ns-vasilev commented on Jul 31, 2025

    @ns-vasilev
    Member

    @vladimirleonidovich hello! Thank you for your bug report. I'll check it as soon as I can.

  2. self-assigned this
    on Jul 31, 2025
  3. added theissue type on Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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