Skip to content

Commit 48ff9b8

Browse files
committed
Check if window exists
1 parent f382484 commit 48ff9b8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,12 @@ export function commitTextUpdate(
759759
textInstance.nodeValue = newText;
760760
}
761761

762+
const supportsMoveBefore =
763+
// $FlowFixMe[prop-missing]: We're doing the feature detection here.
764+
enableMoveBefore &&
765+
typeof window !== 'undefined' &&
766+
typeof window.Node.prototype.moveBefore === 'function';
767+
762768
export function appendChild(
763769
parentInstance: Instance,
764770
child: Instance | TextInstance,
@@ -801,10 +807,6 @@ export function appendChildToContainer(
801807
}
802808
}
803809

804-
const supportsMoveBefore =
805-
// $FlowFixMe[prop-missing]: We're doing the feature detection here.
806-
enableMoveBefore && typeof Node.prototype.moveBefore === 'function';
807-
808810
export function insertBefore(
809811
parentInstance: Instance,
810812
child: Instance | TextInstance,

0 commit comments

Comments
 (0)