title: SwiftUI sheet not dismissing when isPresented value changes from a closure
body: <p>I have a sheet view that is presented when a user clicks a button as shown in the parent view below:</p>
  <pre><code>struct ViewWithSheet: View {
      @State var showingSheetView: Bool = false
      @EnvironmetObject var store: DataStore()
  
      var body: some View {
          NavigationView() {
              ZStack {
                 Button(action: { self.showingSheetView = true }) {
                     Text(&quot;Show sheet view&quot;)
                 }
              }
              .navigationBarHidden(true)
              .navigationBarTitle(&quot;&quot;)
              .sheet(isPresented: $showingSheetView) {
                  SheetView(showingSheetView: self.$showingSheetView).environmentObject(self.dataStore)
              }
          }
      }
  }
  </code></pre>
  <p>In the sheet view, when a user clicks another button, an action is performed by the store that has a completion handler. The completion handler returns an object value, and if that value exists, should dismiss the SheetView.</p>
  <pre><code>struct SheetView: View {
  
      @Binding var showingSheetView: Bool
  
      @EnvironmentObject var store: DataStore()
  
      //@Environment(\.presentationMode) private var presentationMode
  
      func create() {
          store.createObject() { object, error in 
             if let _ = object {
                 self.showingSheetView = false
                 // self.presentationMode.wrappedValue.dismiss()
             }
          }
      }
  
      var body: some View {
          VStack {
              VStack {
                  HStack {
                      Button(action: { self.showingSheetView = false }) {
                          Text(&quot;Cancel&quot;)
                      }
                      
                      Spacer()
                      
                      Spacer()
                      
                      Button(action: { self.create() }) {
                          Text(&quot;Add&quot;)
                      }
                  }
                  .padding()
              }
          }
      }
  }
  </code></pre>
  <p>However, in the create() function, once the store returns values and showingSheetView is set to false, the sheet view doesn't dismiss as expected. I've tried using presentationMode to dismiss the sheet as well, but this also doesn't appear to work.</p>