Thank you for posting this. It helped with my almost identical problem, except I had
@State private var nodeStyle = NodeViewStyle.circles
which needed to change to
@State private var nodeStyle: NodeViewStyle = .circles
Apparently, as you noted, type must be explicitly declared before assignment
This isn’t all of it. It seems there are several triggers. Making it more complicated, there may be a little tolerance. Perhaps one can have several of these ‘bad’ statements in one’s SwiftUI code before Xcode gets out of control?
The statement or construction that triggers this exponential growth in memory usage will be the one of the several possible triggers one adds to one’s code last, making the ‘cause’ appear a little bit random 😦
I am still working on this…