View dissapears after change

Hi everyone,

I am new to coding and wanted to try and make an app. So far it has been going quite well, especially with the useful tips and solutions posted on this forum.

Now something strange has been going on with my project that I am unable to resolve / find on the internet. Im hoping you can help.

I created a short video to demonstrate what is going wrong. You can watch that here: (I don't know where else to upload it)

https://www.youtube.com/watch?v=SY0cja7gitQ&feature=youtu.be

In short the problem is as follows: Whenever i make a change in modifiers / add modifiers, the view completely dissapears. Besides that, the menu that i have made also loses some of its styling, like ignoreSafeEdges and the background opacity.

This also happens on the sideBar.view but not on other views like the login page (contentView). Here is the code for my dashboardView (which is seen in the video). I personally think it has something to do with the sideBar because the other views don't show this sideBar.

import SwiftUI

struct DashboardView: View {
   
  @State private var isSideBarOpened = false
   
  var body: some View {
    ZStack {
      NavigationStack {
        VStack {
          Text("Welkom op het dashboard")
            .font(.title)
            .fontWeight(.bold)
           
            VStack {
               
              Text("Ga direct oefenen hoe u wilt, of kijk of u er klaar voor bent met een oefenexamen!")
                .padding()
               
              HStack {
                Button {
                  // naar practiceView
                } label: {
                  Text("Test")
                }
                .padding()
                 
                Button {
                  // naar practiceExamenView
                } label: {
                  Text("Oefenexamens")
                }
                .padding()
              }
            }
            .border(.gray)
            .padding()
        }
      }
      Sidebar(isSidebarVisible: $isSideBarOpened)
    }
    .navigationBarBackButtonHidden(true)
  }
   
  struct DashboardView_Previews: PreviewProvider {
    static var previews: some View {
      DashboardView()
    }
  }
}

I can also share the sidebar code if you guys/girls think that is necessary. Its not that big of a deal as I can get the view back the by going to the login in page and then return to the dashboardView, but I just want to know / resolve this to prevent it from happening in the live version if it gets released.

Thanks in advance!

View dissapears after change
 
 
Q