By composing, or decomposing, React components together new functionality can be added and functionality can be removed without making any changes to the underlying components. Want to make sure that you dont show a profile page unless someone has been logged in? Wrap your profile page in a
RedirectToLoginIfUnauthorisedcomponent, that checks for the user and redirects to login if they have not yet logged in.
As a bonus when you split and compose your functionality like this you end up with smaller components, that do less. So by following the Open Closed Principle in this way you get the Single Responsibility Principle for free.
Clean Code keeps on delivering.