As with all pyramids of doom, also in SwiftUI it's good idea to isolate and componentize frequently, it's explicitly even stated in WWDC session videos.
However, if you don't want to create entirely new struct for your sub-component, you can also in some cases just create new sibling properties to body in the struct itself, and use them inside body, which pretty much is what your examples seem to want:
struct Test: View {
let stack = VStack {
Text("Foo")
//...
}
var body: some View {
VStack {
//...
stack
.padding()
}
}
}