Skip to content

Commit

Permalink
touch ups
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniGuardiola committed Jul 9, 2024
1 parent fc12b7a commit 394c6e3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type CardProps = {
// You can imagine the implementation...
```

These props and conditionals are quickly adding up. We can easily imagine future variants that require even more props, like `hideFooter`, `image`, `rightAction.tooltip`, `middleAction`, and so on. You might have even seen this in your own codebase.
These props and conditionals are quickly adding up. We can easily imagine future variants that require even more props, like `hideFooter`, `image`, `rightAction.tooltip`, `middleAction`, and so on. You might have even seen something like this in your codebase.

This is what [Kyle Shevlin](https://twitter.com/kyleshevlin) calls "YAP-ing" ("Yet Another Prop" Syndrome). I stole the "Card" example above from his article: ["Quit Your YAP-ing"](https://kyleshevlin.com/quit-your-yapping/). Go read it!

Expand All @@ -182,6 +182,8 @@ YAP-ing presents many potential issues:

I call this type of component (the one that YAPs) **the "everything bagel" component**: a component that tries to do everything and ends up becoming a mess over time.

---

<YoutubeVideo id="aJhKVICLi9s" />

> The video above shows a TV anchor talking to the Dalai Lama. He tries to make a joke:
Expand All @@ -190,6 +192,8 @@ I call this type of component (the one that YAPs) **the "everything bagel" compo
>
> The Dalai Lama doesn't get it. I love this video.
---

Don't get me wrong, there is a time and place for "everything bagel" components! In fact, **I actively recommend** them as long as the following conditions are met:

- The UI fragment you're building is **not overly complex**.
Expand Down

0 comments on commit 394c6e3

Please sign in to comment.