Why using runWithNormalPriority in createProvider?
djknight1 opened this issue · 2 comments
djknight1 commented
While reading source code, it's hard to understand why you using runWithNormalPriority
in createProvider
.
Would you mind explaining it?
dai-shi commented
We want to use useLayoutEffect, because useEffect is not appropriate (too late to change state).
React seems to use high priority in useLayoutEffect, so we need to force changing to normal priority. otherwise, rendering can't be interrupted.