There are at least two common choices:
Set the variable in onAppear instead of on the same line as the declaration
Set the variable in init, like _user = State(initialValue: users.user1)
See https://stackoverflow.com/questions/56691630/swiftui-state-var-initialization-issue
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: