DEV Community

Discussion on: React Is Eating Itself

Collapse
 
bytebodger profile image
Adam Nathaniel Davis • Edited
  1. I almost always have the constructor in my own apps because there's almost always a few other things happening there, so I've gotten too-much in the habit of starting with the constructor "by default". But you're right. It's doing nothing here. So I've removed it.

  2. I just re-jiggered it so that saveCounter() is called first, as a side-effect of the existing state.counter value.

  3. I agree with Michi on this one. Removing the prevState modifier removes the explicit indication that we're updating the current state in relation to previous state. And it's "hardly readable" without a space after the colon?? Meh. Poe-tay-toe / poe-tah-toe. Now we're getting into tabs-vs-spaces territory...