DEV Community

Discussion on: Junior v. Senior React Code: Using Flags with React Components

Collapse
 
mkinoshita12 profile image
Makoto Kinoshita

I think the counterargument would be if you are repeating the same code over and over to avoid passing boolean as a flag, then you are probably abstracting at the wrong level. At the same time, I'm not saying passing a boolean to a function is always a bad idea. There are ways to make it more readable as I mentioned in the article.