Form and List are rendering child views twice

186 Views Asked by At

The following behaviour is kind of unexpected. I have a Form with a simple View inside like this:

Form {
    Text("ChildView")
        .onAppear(perform: { print("APPEAR") })
        .onDisappear(perform: { print("DISAPPEAR") })
}

When the form is rendered the Text is appearing twice and then immediately disappears. Although the Form is rendered once the output is:

APPEAR
DISAPPEAR
APPEAR
DISAPPEAR
APPEAR

The same behaviour applies to List. I would expect that the content of the list or form is rendered only once.

Iam using XCode 12.0GM on iOS 14.

0

There are 0 best solutions below