Skip to content

Commit

Permalink
lint, gating, codes.json
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Nov 30, 2021
1 parent be7b789 commit ea448a4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
});
});

// @gate enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
it('replays event with null target when tree is dismounted', async () => {
let suspend = false;
let resolve;
Expand Down Expand Up @@ -1282,7 +1283,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
container.innerHTML = finalHTML;
suspend = true;

const root = ReactDOM.hydrateRoot(container, <App />);
ReactDOM.hydrateRoot(container, <App />);

const childDiv = container.firstElementChild;
dispatchMouseHoverEvent(childDiv);
Expand Down
3 changes: 1 addition & 2 deletions packages/react-dom/src/events/ReactDOMEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEve
);

// We can dispatch the event now
const blockedOnInst = isBlocked(blockedOn);
let blockedOnInst = isBlocked(blockedOn);
if (!blockedOnInst) {
clearIfContinuousEvent(domEventName, nativeEvent);
dispatchEventForPluginEventSystem(
Expand Down Expand Up @@ -224,7 +224,6 @@ function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEve
eventSystemFlags & IS_CAPTURE_PHASE &&
isDiscreteEventThatRequiresHydration(domEventName)
) {
let blockedOnInst = isBlocked(blockedOn);
while (blockedOnInst) {
const fiber = getInstanceFromNode(blockedOnInst);
if (fiber !== null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/ReactDOMEventReplaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ function replayUnblockedEvents() {
while (queuedDiscreteEvents.length > 0) {
const nextDiscreteEvent = queuedDiscreteEvents[0];
const blockedOn = nextDiscreteEvent.blockedOn;
let blockedOnInst = isBlocked(blockedOn);
const blockedOnInst = isBlocked(blockedOn);
if (blockedOnInst) {
// We're still blocked.
// Increase the priority of this boundary to unblock
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/replayedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export function replayEventWrapper(event: AnyNativeEvent, replay: () => void) {
// the initial unblocking since we'll just dispatch it directly without queueing it
// for replay.
throw new Error(
'Attempting to replay event that is already replaying.' +
'This should never happen. This is a bug in React',
'Attempting to replay event that is already replaying. ' +
'This should never happen. This is a bug in React.',
);
}
eventsReplaying.add(event);
Expand Down
3 changes: 2 additions & 1 deletion scripts/error-codes/codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,6 @@
"415": "Error parsing the data. It's probably an error code or network corruption.",
"416": "This environment don't support binary chunks.",
"417": "React currently only supports piping to one writable stream.",
"418": "An error occurred during hydration. The server HTML was replaced with client content"
"418": "An error occurred during hydration. The server HTML was replaced with client content",
"419": "Attempting to replay event that is already replaying. This should never happen. This is a bug in React."
}

0 comments on commit ea448a4

Please sign in to comment.