-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Description
i spot the difference in how useTransition and useDeferredValue being interrupted by high priority state
when i use useTransition and the transition is on going
and trying to update any other state (that's not in transition) it interrupt the Transition as expected but after couple of seconds of constantly update the state the transition somehow block the ui and update the state like it's updated synchronously
and here is simple the code: https://codesandbox.io/p/sandbox/9hvkwd
when i click on the Post's tab and then quickly before the transition finished constantly update the counter
after couple of seconds the transition will block the ui untill it's finished and painted
but in the useDefferedValue when i interrupt the rendering that attach with the useDeferred it will ALWAYS be interrupted unill i stop typing for example (and that's the expected behavior) then it'll be updated if there is not any high priority stuff going on