title: @State not updating in SwiftUI 2
body: <p>Anybody see problems with @State variables not updating in SwiftUI 2 in Xcode 12b? The problem code is in the contextMenu buttons.</p>
  <p>The <code>showSheet</code> var is toggled to true but the <code>sheetItem</code> value is not changed. This same code worked in SwiftUI 1.</p>
  <p>I have filed a Feedback, but was wondering if anyone else has seen this problem.</p>
  <p>Full code:</p>
  <pre><code>struct ConnectionsView: View {
  
  @EnvironmentObject var connectionViewModel : FileDataViewModel&lt;Connection&gt;
  
  @State private var editMode = EditMode.inactive
  @State private var importedConnections = false
  @State private var showEditSheet = false
  @State private var selectedIndex = 0
  @State private var showSheet = false
  @State private var sheetItem = SheetItem.openFile //TOD: Set back to .none when ButtonActions fixed
  @State private var newConnection = Connection()
  
  var body : some View {
      NavigationView {
          List {
              ForEach(connectionViewModel.items) { connection in
                  NavigationLink (destination: SSHSessionView (connection: connection)) {
                      ConnectionView(connection: connection)
                          //pass tap through the view to allow the NavigationLink to work
                          .allowsHitTesting(self.editMode == .inactive ? false : true)
                          .onTapGesture {
                              if self.editMode.isEditing {
                                  self.selectedIndex = self.connectionViewModel.items.firstIndex(where: {$0.id == connection.id})!
                                  self.sheetItem = .editItem
                                  self.showSheet.toggle()
                              }
                          }
                  }
              }
              .onDelete(perform: deleteItem)
              .onMove(perform: moveItem)
          }
          .onAppear {
              UITableView.appearance().tableFooterView = UIView()
          }
          .navigationBarTitle(&quot;Connections&quot;, displayMode: .large)
          .navigationBarItems(
              leading:
                  EditButton()
                      .hoverWithPaddingModifier(),
              trailing:
                  Button(action: {
                  }, label: {
                      Image(systemName: &quot;plus&quot;)
                  })
                  .contextMenu {
                      Button(&quot;New Connections file...&quot;, action: {
                          sheetItem = .newFile
                          showSheet.toggle()
                      })
                      Button(&quot;Open Connections file...&quot;, action: {
                          sheetItem = .openFile
                          showSheet = true
                      })
                      if connectionViewModel.fileOpened {
                          Button(&quot;New Connection&quot;, action: {
                              sheetItem = .newItem
                              showSheet.toggle()
                          })
                      }
                  }
          )
              
          .environment(\.editMode, $editMode)
          
          .sheet(isPresented: $showSheet, content: {
              
              if self.sheetItem == .editItem {
                  AddEditConnectionView (connection: self.$connectionViewModel.items[self.selectedIndex], newConnection: false)
                      .environmentObject(self.connectionViewModel)
              }
              
              if self.sheetItem == .newFile {
                  FilePickerView(callback : self.importedConnections == false ? self.pickedDocuments : self.newDocFromServerList, UTIs : connectionUTIs, newFileURL : FileDataViewModel&lt;Connection&gt;.getBlankFile (fileType : ViewTypes.connections)!)
              }
              
              if self.sheetItem == .openFile {
                  FilePickerView(callback : self.pickedDocuments, UTIs : connectionUTIs, newFileURL: nil)
              }
  
              if self.sheetItem == .newItem {
                  AddEditConnectionView (connection: self.$newConnection, newConnection: true)
                      .environmentObject(self.connectionViewModel)
              }
          })
      }
  }
  </code></pre>