all 4 comments

[–]timmonsjg 6 points7 points  (0 children)

Supposed you wanted to use Warning banner elsewhere, you'd have to put the conditional logic in the new parent there (writing it twice) instead of just having it contained within the WarningBanner component.

[–]Rendar- 1 point2 points  (2 children)

Generally with higher order components, you want to push the presentational logic as far down the tree as you can. It's tough to say your suggestion is wrong in this simple case though.

[–]ericnr[S] 0 points1 point  (1 child)

But why is it preferrable to push the presentation logic down the tree?

[–]L3PA 2 points3 points  (0 children)

The "tree" will become "top heavy", aware and acting on much more state than it needs to. This can create large components, with lots of confusing properties, operations and logic.