MCPcopy Create free account
hub / github.com/clayrisser/create-react-renderer / createElement

Function createElement

phaseL/src/createElement.ts:5–10  ·  view source on GitHub ↗
(elementType: string, props: any)

Source from the content-addressed store, hash-verified

3import { getContext } from "./context";
4
5export default function createElement(elementType: string, props: any) {
6 const { parserOptions } = getContext();
7 const Element: IElement = elements[elementType];
8 if (!Element) throw new Error(`unknown element of type '${elementType}'`);
9 return new Element(props, parserOptions);
10}

Callers 1

createInstanceFunction · 0.70

Calls 1

getContextFunction · 0.90

Tested by

no test coverage detected