Writing / tag
#react
React patterns, and when a clever one earns its place. One post, newest first.

switch(true) in React: First True Wins
5 min read
switch(true) runs the first case that is true, which makes it a tidy way to write ordered conditions. It is the right tool less often than it looks. Here is when it earns its place.
#react#javascript