dai-shi / will-this-react-global-state-work-in-concurrent-rendering

Test tearing and branching in React concurrent rendering
MIT License
558 stars 45 forks source link

unstable_enableVersionedWrite info? #57

Closed salvoravida closed 2 years ago

salvoravida commented 2 years ago

Hi there! great work!

I'm curious, where I can find more code about unstable_enableVersionedWrite ?

I founded this:

if (unstable_enableVersionedWrite) {
  scopeContainerRef.current.w = (write) => {
    setVersion((parentVersion) => {
      const nextVersion = parentVersion ? { p: parentVersion } : {};
      write(nextVersion);
      return nextVersion;
    });
  };
}
dai-shi commented 2 years ago

https://github.com/pmndrs/jotai/pull/854 Note that this is highly experimental.

Closing, but feel free to comment here.