May 1, 2021
Thanks for reading! The idea behind setting the subcomponents as properties of the parent is that it makes the relationship between Modal and Modal.Header explicit, and encourages you not to use a Modal.Header anywhere other than inside a Modal. The pattern is completely optional and a matter of taste, but I like the additional clarity it gives you.