DEV Community

Discussion on: Refactoring React: Applying Tell Don't Ask

Collapse
 
lico profile image
SeongKuk Han • Edited

I think when someone sees the usage of Banner, they don't know how the component works. If that's used just for visibility, how about adding a property like visible to Banner? That seems more clear in that case.


Applying Tell Don't Ask, we avoid querying and depending on the internal state of a collaborator object. Instead, the owner of that state -- or behavior, should decide what to do.

Anyways, this is good. Thanks for your post :)