( children: ReactNodeList, container: Element | DocumentFragment, key: ?string = null, )
| 73 | } |
| 74 | |
| 75 | function createPortal( |
| 76 | children: ReactNodeList, |
| 77 | container: Element | DocumentFragment, |
| 78 | key: ?string = null, |
| 79 | ): React$Portal { |
| 80 | if (!isValidContainer(container)) { |
| 81 | throw new Error('Target container is not a DOM element.'); |
| 82 | } |
| 83 | |
| 84 | // TODO: pass ReactDOM portal implementation as third argument |
| 85 | // $FlowFixMe[incompatible-return] The Flow type is opaque but there's no way to actually create it. |
| 86 | return createPortalImpl(children, container, null, key); |
| 87 | } |
| 88 | |
| 89 | // Overload the definition to the two valid signatures. |
| 90 | // Warning, this opts-out of checking the function body. |
nothing calls this directly
no test coverage detected