Skip to content

Bug: Different Behaivor between useTransition and useDeferredValue #34408

@yousefdawood7

Description

@yousefdawood7

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: StaleAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions