Jack Taylor
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.

--

--

Jack Taylor
Jack Taylor

Written by Jack Taylor

I am a UI developer writing about JavaScript, React and tech in general. Currently working at Pleo.

No responses yet