mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Constrain the container type of createPortal (#24496)
We already constrained the type of createRoot (can't take document) and hydrateRoot (can't take fragments).
This commit is contained in:
committed by
GitHub
parent
3dc9a8af05
commit
024a7274fb
+1
-1
@@ -107,7 +107,7 @@ setBatchingImplementation(
|
||||
|
||||
function createPortal(
|
||||
children: ReactNodeList,
|
||||
container: Container,
|
||||
container: Element | DocumentFragment,
|
||||
key: ?string = null,
|
||||
): React$Portal {
|
||||
if (!isValidContainer(container)) {
|
||||
|
||||
Reference in New Issue
Block a user