DEV Community

Discussion on: React Hooks and Local Storage: Let’s build a ToDo app

Collapse
 
schinta2 profile image
siva sandeep chintamaneni

"As opposed to state in class components, useState does not work with object values." - Is this accurate?
Wondering if I misunderstood that statement as I believe, the following post has a working example of using object value instead
dev.to/reedbarger/react-hooks-chea...

Collapse
 
saranshk profile image
saransh kataria

Thanks for pointing that out. The verbiage is incorrect. It does work with object values, but primitives can be used as well and it is the preferred way of using it unless the values in the object are related. I will update the post to reflect the same.