MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / createElement

Function createElement

packages/jsx/src/createElement.ts:202–218  ·  view source on GitHub ↗
(
  type: JsxElementType,
  props: Readonly<Record<string, unknown>> | null,
  key?: string,
)

Source from the content-addressed store, hash-verified

200 * Create a Rezi VNode from JSX runtime inputs.
201 */
202export function createElement(
203 type: JsxElementType,
204 props: Readonly<Record<string, unknown>> | null,
205 key?: string,
206): VNode {
207 const normalizedProps = normalizeProps(props, key);
208
209 if (typeof type === "function") {
210 return (type as (props: Record<string, unknown>) => VNode)(normalizedProps);
211 }
212
213 if (!isIntrinsicElementName(type)) {
214 throw new Error(`Unknown JSX element type: ${type}`);
215 }
216
217 return intrinsicFactories[type](normalizedProps);
218}
219
220/**
221 * Classic JSX factory function alias.

Callers 15

jsxDEVFunction · 0.90
lineTreeFunction · 0.85
benchmarkTreeFunction · 0.85
rerenderTreeFunction · 0.85
contentUpdateTreeFunction · 0.85
layoutStressTreeFunction · 0.85
scrollStressTreeFunction · 0.85
virtualListTreeFunction · 0.85
tablesTreeFunction · 0.85
memoryProfileTreeFunction · 0.85
terminalRerenderTreeFunction · 0.85
terminalFrameFillTreeFunction · 0.85

Calls 2

normalizePropsFunction · 0.85
isIntrinsicElementNameFunction · 0.85

Tested by

no test coverage detected