@samitouri / QOS-React-2 / commits / 024a7274fb

Constrain the container type of createPortal (#24496)

We already constrained the type of createRoot (can't take document) and hydrateRoot (can't take fragments).

Sebastian Markbåge committed May 4, 2022 at 23:05 UTC 024a7274fb07f154676ec6443b83a4e31f259c22
1 file changed +1 -1
packages/react-dom/src/client/ReactDOM.js
+1 -1
@@ -107,7 +107,7 @@ setBatchingImplementation(
107
108 function createPortal(
109 children: ReactNodeList,
110 - container: Container,
110 + container: Element | DocumentFragment,
111 key: ?string = null,
112 ): React$Portal {
113 if (!isValidContainer(container)) {