Skip to main content
XenonStack

Software Development

XenonStack Blog React Without JSX: createElement and the Modern Transform

and | Published | Updated

React Without JSX: createElement and the Modern Transform
10:54

Key takeaway

  • React without JSX explained: how createElement works, what the modern JSX transform does, and when enterprise teams should keep JSX or skip it.

You can write React without JSX. JSX is optional syntax that a compiler turns into plain JavaScript calls, and the React documentation lists createElement as the way to build elements when you do not want JSX or cannot use it. The same documentation places createElement among its legacy APIs and says it is not recommended for newly written code, so treat it as a tool for specific cases, not a default.

For enterprise teams the decision is about build pipelines, maintainability and risk, not taste. This guide shows what JSX compiles to, how to run React with no build step, what changed in React 19 that breaks older tutorials, and when to keep JSX. If you are choosing a front-end approach for a product team, see our React.js application development services for how we approach it.

What is JSX, and what does React do with it?

JSX is a syntax extension for JavaScript that lets you write HTML-like markup inside JavaScript files. A compiler such as Babel converts it into plain JavaScript, because browsers cannot run JSX directly. React and JSX are separate things: React is a library, and the React documentation says they are often used together but can be used independently.

Two-column diagram mapping JSX elements, components and lists on the left to the equivalent createElement calls on the right, with the rule to choose JSX unless it cannot be compiled.

Before React 17, the compiler turned every JSX element into a React.createElement call. The newer transform imports special functions from the React package instead, so you no longer need to import React just to use JSX. The old transform keeps working, but the new one is the one to use.

JSXPlain JavaScript equivalentNote
<h1 className="greeting">Hello</h1>createElement('h1', { className: 'greeting' }, 'Hello')The tag name is a string. class is reserved in JavaScript, so React uses className.
<Tag name="Asha" age={31} />createElement(Tag, { name: 'Asha', age: 31 })A capitalised name is a component. A lower-case name is a built-in HTML tag.
<ul>{items}</ul>createElement('ul', null, items)For dynamic children, pass the whole array as one argument so React can warn about missing keys.

How does React.createElement work?

The signature is createElement(type, props, ...children). The type is a tag name string such as 'div', or a component such as a function, a class or Fragment. The props argument is an object or null, and everything after it is a child node: elements, strings, numbers, empty nodes or arrays of nodes.

It returns a plain object with type, props, ref and key. The documentation advises treating every element as opaque after creation and only rendering it. In development, React freezes the element and its props shallowly, so do not mutate them.

import { createElement } from 'react';

function Greeting({ name }) {
  return createElement(
    'h1',
    { className: 'greeting' },
    'Hello ',
    createElement('i', null, name),
    '. Welcome!'
  );
}

This is the example from the React documentation, and it is equivalent to <h1 className="greeting">Hello <i>{name}</i>. Welcome!</h1>. The documentation says both coding styles are fine, and that the main benefit of JSX is that it is easy to see which closing tag matches which opening tag. That benefit grows quickly with nested markup.

How do props and children map across?

The second argument carries props, so createElement('div', { className: 'first-css-class' }, 'First element') renders a div with that class. Pass null when there are no props. The key and ref props are special: they appear as element.key and element.ref, not inside element.props.

How do you run React without JSX and without a build step?

Without JSX there is nothing to compile, so you can load React from script tags and write plain JavaScript. The catch is how you load it. Since React 19, React no longer produces UMD builds, so the older pattern of loading react.development.js from a CDN with a plain script tag does not work for new versions. The React 19 upgrade guide recommends an ES module CDN such as esm.sh instead. The sketch below follows the pattern in that guide, with createRoot in place of the removed ReactDOM.render.

<div id="root"></div>
<script type="module">
  import React from "https://esm.sh/react@19/?dev";
  import ReactDOMClient from "https://esm.sh/react-dom@19/client?dev";

  const e = React.createElement;
  const root = ReactDOMClient.createRoot(document.getElementById("root"));
  root.render(e("h1", null, "Hello, world"));
</script>

createRoot takes a DOM node and returns an object with render and unmount. The first render call clears any HTML already inside the root. For production, pin exact versions and host the files yourself where your security policy requires it.

What has changed since older React without JSX tutorials?

Many guides on this topic, including the earlier version of this one, were written for React 16. As of 11 November 2026 the latest React release listed on react.dev is 19.3, published on 9 September 2026. The table lists what to fix when you meet an older tutorial.

Older patternCurrent statusWhat to use
ReactDOM.render(element, node)Deprecated in React 18.0.0 (March 2022) and removed in React 19.createRoot(node).render(element) from react-dom/client
UMD script tags such as react@16/umd/react.development.jsReact 19 no longer produces UMD builds.An ES module CDN such as esm.sh, or a bundler
Old JSX transform (React.createElement output)Still works, but React 19 features such as ref as a prop and JSX speed improvements need the new transform.The automatic runtime. In Babel 7.9.0 or later, set "runtime": "automatic"
createFactoryRemoved in React 19.JSX or createElement
Create React AppDeprecated for new apps on 14 February 2025.A framework such as Next.js, React Router or Expo, or a build tool such as Vite, Parcel or Rsbuild
createElement for new codeListed under legacy APIs, not recommended for newly written code.JSX, unless you cannot compile it

When should an enterprise team use JSX, and when createElement?

SituationBetter fitWhy
Product application with many components and several developersJSX with a framework or ViteEasier to read and review, and it is what the official documentation and most codebases use.
Small interactive widget on an existing page that has no build toolingcreateElement with an ES module CDNNo compiler to maintain. The React documentation lists createElement for cases where you cannot use JSX.
Generated UI, for example markup produced by code from a schemacreateElementBuilding elements by calling a function with data is simpler than generating JSX text.
Teaching what the compiler doescreateElement first, then JSXIt shows that JSX is a syntax over function calls.
Team adding React to part of an existing site over timeJSX through ViteReact documentation suggests starting with small components and moving upwards, and it points to Vite when no module setup exists.

What are the trade-offs and when should you not skip JSX?

Skip JSX only with a reason. Nested createElement calls become hard to read as screens grow, code review takes longer, and new developers expect JSX. Tooling such as editors, linters and component libraries assumes it. For medium-sized and larger projects, stay with JSX. Use plain calls for small, contained pieces where avoiding a build step is the real saving.

What about governance, security and cost?

Removing the build step removes one moving part, but it moves risk to runtime. A page that loads React from a public CDN depends on that CDN at every page view, so pin exact versions, review the policy for third-party scripts, and consider self-hosting for regulated systems. A build pipeline costs engineering time but gives you lockfiles, audits and repeatable releases. Weigh that against the size of the surface you are shipping.

The same discipline applies when React front ends sit in front of AI agents. Teams that build agent-driven interfaces on ElixirClaw, an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control, still need a clean, reviewable front-end layer. For delivery teams, AgentScrum describes itself as an AI tool for sprint planning and Scrum ceremonies, and ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents.

How does React differ from plain JavaScript for UI updates?

The main difference is how each responds to user interaction, such as clicking a button to add an item to a list. In plain JavaScript you find elements in the DOM, attach a click listener, read the input, create a list node and append it yourself. In React you keep the list in state, describe the UI from that state, and React updates the DOM when the state changes.

const [items, setItems] = useState(['apple', 'orange', 'toast']);

function addItem(newItem) {
  setItems([...items, newItem]);
}

// With JSX
<ul>
  {items.map(item => <li key={item}>{item}</li>)}
</ul>

// Without JSX
createElement('ul', null,
  items.map(item => createElement('li', { key: item }, item))
)

Both versions behave the same. You do not look up the list in the DOM to attach new items, because React handles that. For more on structure, see React.js project structure and folder setups, and for load time see code-splitting in React.js.

What is a sensible adoption sequence?

  1. Write one small component with createElement to see what JSX compiles to.
  2. Check which React version and JSX transform your toolchain uses, and move off removed APIs such as ReactDOM.render.
  3. For new applications, choose a framework or a build tool and use JSX.
  4. Keep plain-call components for contained cases where a build step is not worth adding.
  5. Add tests early. See React.js testing of components, and type checking with PropTypes for passing read-only values between components.

To map one front-end or AI-assisted decision your team makes, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions

Is JSX required to use React?

No. JSX is a syntax extension and React is a separate library. You can build elements with createElement, although most codebases use JSX.

Is React.createElement deprecated?

The React documentation lists it under legacy APIs and does not recommend it for newly written code, but it is not removed, and the page says both styles are fine. React 19 did remove createFactory.

Why does ReactDOM.render fail in React 19?

It was deprecated in React 18.0.0 and removed in React 19. Import createRoot from react-dom/client and call root.render.

Can I use React from a script tag without a build step?

Yes, but React 19 no longer ships UMD builds. The upgrade guide recommends an ES module CDN such as esm.sh, loaded in a type="module" script.

What does the new JSX transform change?

It imports special functions from the React package instead of compiling to React.createElement, so you no longer import React only to use JSX. It needs React 17 or later, or a backported version, and a supporting tool such as Babel 7.9.0 or later.

Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue