5 ms·
Redux adds complexity as well, but I agree that the code looks to be much more repetitive than is necessary. I have never seen multiple calls to setState put on
by gatherhunterer 7y ago
Redux adds complexity as well, but I agree that the code looks to be much more repetitive than is necessary. I have never seen multiple calls to setState put one after another like that and it does seem disingenuous to make it look like people write React class components that way.
- acemarke 7y agoI'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.
- gatherhunterer 7y agoA 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.
- acemarke 7y agoThat'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.