diff --git a/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js b/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js index a7846ab455214..3567fe708983c 100644 --- a/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js +++ b/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js @@ -537,7 +537,7 @@ export function retryIfBlockedOn( if (enableFormActions) { // Check the document if there are any queued form actions. - const root = unblocked.getRootNode(); + const root = unblocked.ownerDocument; const formReplayingQueue: void | FormReplayingQueue = (root: any) .$$reactFormReplay; if (formReplayingQueue != null) { diff --git a/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js b/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js index 4d826753dc097..09bd265de0751 100644 --- a/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js +++ b/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js @@ -198,7 +198,7 @@ export function listenToFormSubmissionsForReplaying() { // where we preserve sequencing and where we'll pick it up from during hydration. // In practice, this is just the same as document but we might support shadow trees // in the future. - const root = form.getRootNode(); + const root = form.ownerDocument; (root['$$reactFormReplay'] = root['$$reactFormReplay'] || []).push( form, submitter,