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

Test tearing and branching in React concurrent rendering

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jotai is a good choose for react concurrent mode?

qinjialei24 opened this issue · comments

Good Job!But i have some questions

I see this issue
image

As you can see from above,jotai is not good enough for react concurrent mode,So would you have plans to make this(CM) better ?

Concurrent React is not finalized and it's basically predicting the future.
That said, it's still something we believe is better or friendly for concurrent react.
We would like to make it better, but at this point it's the best we could do.

Please refer: reactwg/react-18#70
We are still at level 1, but can go to level 2 instantly once React releases useMutableSource.
Our hope is to reach level 3, eventually.

Another example is to use a mutable store with immutable snapshots which do not change during render, but this strategy is still under research.

It's still under research. react-tracked can probably fulfill "with immutable snapshots which do not change during render". jotai does not do at this moment, but would add some restriction or convention in the api to follow this. zustand and valtio will never do this by design.

Please note that as app developers it's not super important to follow this. This is just one aspect of following new react features to get some benefits, but they might not fit with all apps requirements.

Closing, but feel free to continue discussion.