I am attempting to create a 'Shortcuts' style interface where you can pick one or more actions from a list and add them to your 'workflow'. This would involve dynamically inserting views into an array. I realise this can be done using AnyView but with the performance implications it has this seems like a bad idea.
My initial (perhaps naive) approach was to do the following:
struct WorkflowView<Action: View>: View {
  
  var actionItems: [Action] = []
  var body: some View {
    ...
  }
}
But this causes an issue at the call site since the compiler needs to know the type for the array you are passing in
  WorkflowView(actionItems: [Text("Hi"), Image(systemImage: "circle")]) // Compiler error as it can't determine the type for the array
Is there any way to do this without using AnyView?
<Action: View>you are going work with<Action1: View, Action2: View, Action3: View, ...>