Hacker News new | ask | show | jobs
by acemarke 2386 days ago
I've seen a _lot_ of folks put multiple separate `setState` calls in a row, one for each field they want to update. I make sure to point out that it's nicer to read if they're collapsed into a single call, but it's a very common thing.
1 comments

A scrum master or maintainer needs to proofread and prevent this. That is is the purpose of code review. It’s too bad that repetition does not stand out as a mistake to so many with whom you have worked.
That's literally my point.

Folks learning React will do that at first, because they don't know better. We _have_ caught that in code reviews, taught them not to do that, and moved on.

But yes, it is an actual thing I have seen people (coworkers and otherwise) do, not some made-up problem.