“Error con Preview @FocusState Swiftui” Código de respuesta

Error con Preview @FocusState Swiftui

// The workaround I found here is to wrap the preview in a ZStack, like so:
// @anarchymedes
@MainActor
struct TripInfoView_Previews: PreviewProvider {
    @StateObject static var currenttrip: TripStore = TripStore.instance
    static var previews: some View {
        ZStack {
            TripInfoView(currenttrip: currenttrip, tripPartIndex: .constant(0), signalclosure: nil, readOnlyMode: .constant(false)).environmentObject(currenttrip)
        }
    }
}
Shiny Shark

Error con Preview @FocusState Swiftui

@MainActor
struct TripInfoView_Previews: PreviewProvider {
    @StateObject static var currenttrip: TripStore = TripStore.instance
    static var previews: some View {
        ZStack {
            TripInfoView(currenttrip: currenttrip, tripPartIndex: .constant(0), signalclosure: nil, readOnlyMode: .constant(false)).environmentObject(currenttrip)
        }
    }
}
Shiny Shark

Respuestas similares a “Error con Preview @FocusState Swiftui”

Preguntas similares a “Error con Preview @FocusState Swiftui”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código