SwiftUI sheet doesn't access the latest value of state variables on first appearance

It seems like the state variable are not properly updated when a sheet is displayed for the first time. For instance with this code: import SwiftUI struct DemoView: View { @State var showDetai...