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

Function createPortal

packages/react-reconciler/src/ReactPortal.js:15–33  ·  view source on GitHub ↗
(
  children: ReactNodeList,
  containerInfo: any,
  // TODO: figure out the API for cross-renderer implementation.
  implementation: any,
  key: ?string = null,
)

Source from the content-addressed store, hash-verified

13import type {ReactNodeList, ReactPortal} from 'shared/ReactTypes';
14
15export function createPortal(
16 children: ReactNodeList,
17 containerInfo: any,
18 // TODO: figure out the API for cross-renderer implementation.
19 implementation: any,
20 key: ?string = null,
21): ReactPortal {
22 if (__DEV__) {
23 checkKeyStringCoercion(key);
24 }
25 return {
26 // This tag allow us to uniquely identify this as a React Portal
27 $$typeof: REACT_PORTAL_TYPE,
28 key: key == null ? null : '' + key,
29 children,
30 containerInfo,
31 implementation,
32 };
33}

Callers

nothing calls this directly

Calls 1

checkKeyStringCoercionFunction · 0.90

Tested by

no test coverage detected