DEV Community

Discussion on: N Temptations To Avoid While "React"ing.

Collapse
 
carlosrafael22 profile image
Rafael Leitão

Hey Sahil, nice article!
It does cover some misconceptions that we need to fix.

I'd only give a suggestion to use spread operator instead of Object.assign() in the last code, I think it's easier to read as well. It could be like this:

 return {...shop, open: !shop.open}
Enter fullscreen mode Exit fullscreen mode

Congrats for your first article! :)