Post

Replies

Boosts

Views

Activity

Reply to Infinite loop refreshing view with EnvironmentValue
Observing the same behaviour even without NavigationStack. It can be reproduced with simpler code. Xcode 15.2, iOS 17.2. struct ContentView: View { @Environment(\.openURL) private var openURL var body: some View { let _ = Self._printChanges() Text("Hello, world!") } } This code prints out: ContentView: @self, @identity, _openURL changed. ContentView: _openURL changed. If I comment out openURL's Environment variable, the code prints out expected one redraw: ContentView: @self changed. This behaviour seems expected, but I cannot find any information on how to mitigate the redraws.
Jun ’24