As I learned from this comment it works to pass a component as the second argument of turbo_stream.replace:
render turbo_stream: [
turbo_stream.replace("a", Components::A.new),
turbo_stream.replace("b", Components::B.new)
]
But is it possible to pass a fragment?
render turbo_stream: [
turbo_stream.replace("a", Components::A.new(**args).call(fragments: ["A1"])),
turbo_stream.replace("b", Components::B.new(**args).call(fragments: ["B1"]))
]
This is not working for me, I'm getting ActionView::Template::Error: wrong number of arguments (given 1, expected 0).
I guess I could make the fragment a sub-component.