DEV Community

Discussion on: Global state management in React with global variables and hooks. State management doesn't have to be so hard.

Collapse
 
mbjelac profile image
Marko Bjelac

haven't checked the lib implementation but checking whether the new value is different then the old with === doesn't work on objects (just checks the heap reference). would this be desirable?

Collapse
 
yezyilomo profile image
Yezy Ilomo

Lib implementation depends on immer to compare objects, so it works just fine.