Neat little trick! Yes, I remember debating with myself how setState should behave. Certainly having it do shallow-merging automatically would cut out a good bit of boilerplate. I might have just stuck with the default behavior for the sake of a simpler article. To be honest I can’t remember how I came to my conclusion lol. Anyhow, thanks for the addition!

Software Engineer at Scenery

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store