I've noticed for a few state libraries, including zustand, use useRef, diff the previous value and then forceRender(), instead of leaving this to useState which does all this for free. Why is that?
My guess it's something to do with isomorphic layouts?
I've noticed for a few state libraries, including zustand, use
useRef, diff the previous value and then forceRender(), instead of leaving this touseStatewhich does all this for free. Why is that?My guess it's something to do with isomorphic layouts?