MCPcopy
hub / github.com/facebook/react / createPortal

Function createPortal

packages/react-dom/src/shared/ReactDOM.js:56–68  ·  view source on GitHub ↗
(
  children: ReactNodeList,
  container: Element | DocumentFragment,
  key: ?string = null,
)

Source from the content-addressed store, hash-verified

54}
55
56function createPortal(
57 children: ReactNodeList,
58 container: Element | DocumentFragment,
59 key: ?string = null,
60): React$Portal {
61 if (!isValidContainer(container)) {
62 throw new Error('Target container is not a DOM element.');
63 }
64
65 // TODO: pass ReactDOM portal implementation as third argument
66 // $FlowFixMe[incompatible-return] The Flow type is opaque but there's no way to actually create it.
67 return createPortalImpl(children, container, null, key);
68}
69
70export {
71 ReactVersion as version,

Callers 5

FrameFunction · 0.90
TimelineSearchInputFunction · 0.90
portaledContentFunction · 0.90
ContextMenuFunction · 0.90
Page.jsFile · 0.90

Calls 1

isValidContainerFunction · 0.90

Tested by

no test coverage detected