createElement
The React function that creates a React element from a type, a props object and children; JSX used to compile to calls of it.
In more detail
createElement still works and is handy when you cannot use JSX. Modern compilers call the jsx function from the JSX runtime instead, but both return the same kind of plain element object.
Example
React.createElement("h1", { className: "title" }, "Hello")Related terms
- JSX runtime — The small module that compiled JSX calls, so each tag becomes a jsx function call imported automatically from react/jsx-runtime.
- React element — A plain, read-only JavaScript object describing one piece of UI: its type, its props and an optional key.
- JSX — The HTML-like syntax used in React code, such as <Button size="lg">Save</Button>, which compiles to JavaScript function calls.
Taught in
- JSX Transpilation: createElement, JSX Runtime, React Elements — React 19 & Modern Component Architecture