MCPcopy Create free account
hub / github.com/RobPruzan/react-scratch / createElement

Function createElement

src/react/core.ts:468–482  ·  view source on GitHub ↗
(
  component: ReactComponentExternalMetadata<T>["component"],
  props: T,
  ...children: Array<ReactComponentInternalMetadata | null | false | undefined>
)

Source from the content-addressed store, hash-verified

466 : "empty-slot");
467
468export const createElement = <T extends AnyProps>(
469 component: ReactComponentExternalMetadata<T>["component"],
470 props: T,
471 ...children: Array<ReactComponentInternalMetadata | null | false | undefined>
472): ReactComponentInternalMetadata => {
473 const internalMetadata = mapExternalMetadataToInternalMetadata({
474 externalMetadata: {
475 children: children,
476 component,
477 props,
478 },
479 });
480
481 return internalMetadata;
482};
483
484const findParentViewNode = (id: string): ReactViewTreeNode => {
485 const aux = (viewNode: ReactViewTreeNode): ReactViewTreeNode | undefined => {

Callers 1

createContextFunction · 0.85

Tested by

no test coverage detected