Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
https://devrant.com/rants/7705194/...
See last comment here.
const object = ...
is not the same as a destructured variable, as the object is not immutable. -
msdsk31801y@IntrusionCM
I understand the idea behind the setter and the immutability but I simply think it's inelegant to handle it this way. JS objects can have proper setters, we don't need to reinvent a wheel (and patterns) here. Look at Vue, you initialize an object and then you can "directly" manipulate its .value. For me it feels like a design decision from somebody who started to work around the beginning around es 2015 and just thinks that restructuring is the end of it all.
Who the fuck thought that in react useState should return an array and not an object. It makes me wanna make a wrapper that would instead return {current, set} = useSaneState('fuck you') because what the fuck does it have to do with arrays. And an object with shit.current would be consistent with useRef.
Also, vue is just superior in naming and coding standards.
rant