Which is the best approach to associate a SwiftUI View with other data?

You can’t just have a [Demo], it has to be a [Demo<Something>]. When you say [Demo] it tries to figure out what that Something is for you, but realizes that each entry in the array has a different Something.

Without knowing more about your situation, I can only suggest the escape hatch of having Demo use AnyView instead of a generic. That may not be necessary though depending on what you’re trying to do.