DEV Community

Discussion on: use-dark-mode-hook: A Simple Library To Add Dark Mode to Your React Project

Collapse
 
ceoshikhar profile image
Shikhar

Returning an object instead of array seem to be more cleaner to me.

Collapse
 
shahednasser profile image
Shahed Nasser

I’m adapting the same idea of “useState” that’s why

Collapse
 
ceoshikhar profile image
Shikhar

But this adaption doesn't go so well with custom hooks, does it? Idk, vast majority of custom hooks seem to either return single value or an object. Makes it cleaner to just de-structure the object, which is the case most of the time.