Skip to content

Commit

Permalink
Addresses a TODO to use the resolved update priority which considers …
Browse files Browse the repository at this point in the history
…window.event when setting the update priority for explicit hydration.
  • Loading branch information
gnoff committed Apr 5, 2024
1 parent dd91321 commit 1e66ae1
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {isHigherEventPriority} from 'react-reconciler/src/ReactEventPriorities';
import {isRootDehydrated} from 'react-reconciler/src/ReactFiberShellHydration';
import {dispatchReplayedFormAction} from './plugins/FormActionEventPlugin';
import {
peekCurrentUpdatePriority,
resolveUpdatePriority,
runWithPriority as attemptHydrationAtPriority,
} from '../client/ReactDOMUpdatePriority';

Expand Down Expand Up @@ -333,10 +333,7 @@ function attemptExplicitHydrationTarget(
}

export function queueExplicitHydrationTarget(target: Node): void {
// TODO: This will read the priority if it's dispatched by the React
// event system but not native events. Should read window.event.type, like
// we do for updates (getCurrentEventPriority).
const updatePriority = peekCurrentUpdatePriority();
const updatePriority = resolveUpdatePriority();
const queuedTarget: QueuedHydrationTarget = {
blockedOn: null,
target: target,
Expand Down

0 comments on commit 1e66ae1

Please sign in to comment.