( type: JsxElementType, props: Readonly<Record<string, unknown>> | null, key?: string, )
| 200 | * Create a Rezi VNode from JSX runtime inputs. |
| 201 | */ |
| 202 | export 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. |
no test coverage detected