When presenting this view with a PresentationButton it crashes the preview and the Simulator. When presented with a NavigationButton, it works fine. Is this intended behavior? Should EnvironmentObject not work with modal presentations?
import SwiftUI
struct AddListView : View {
@EnvironmentObject var listStore: LinkListStore // Cause of crash
var body: some View {
Text("HELLO")
}
}
#if DEBUG
struct AddListView_Previews : PreviewProvider {
static var previews: some View {
AddListView()
.environmentObject(LinkListStore())
}
}
#endif