5
AllenII
7y

Just got reminded wgy switch statements are usually frowned upon.
Forgot the breaks; i spent quite possibly, an hour trying to figure out why my button wouldn't update with my state properly 😭😭

Comments
  • 2
    Was that in a redux reducer? I always end a case with a return statement, so never had that problem.
  • 0
    @shellbug nope, the render method--it was a button that toggled a filter between four states. The fact that i quickly grew so accustomed to returning in the switch is exactly what caused me to forget the break in another case πŸ˜…πŸ˜…πŸ˜…
Add Comment