I'm trying to inject a view into another view to avoid code duplication.
I came up with the idea of this:
struct WrapperView: View {
var injectedView: some View
var body: some View {
VStack {
injectedView
}
}
}
But I get an error: Property declares an opaque return type, but has no initializer expression from which to infer an underlying type
How can I achieve something like this in SwiftUI?