JSX Without a Transpiler: The Raw API
You'll learn: What JSX actually becomes when you remove the friendly syntax and write raw React code.
The Unmasked Reality
You've learned that JSX compiles to React.createElement() calls. But what does it feel like to write React without JSX? Let's experience the raw API directly—no Babel, no transpiler, just pure JavaScript function calls.
Writing Components the Hard Way
Instead of writing:
<div className="card">
<h1>Hello</h1>
</div>
You'd write:
React.createElement(
'div',
{ className: 'card' },
React.createElement('h1', null, 'Hello')
)
Every element becomes a function call. Every nested element becomes a nested function call. Children are arguments that keep piling up.
Why This Matters
Seeing the raw API helps you understand:
- JSX is just sugar — There's no magic, just function calls
- The createElement signature — Type, props object, then children
- Why JSX exists — Writing nested UIs this way is brutally verbose
- What the transpiler does — It transforms your clean JSX into these calls
Analogy: JSX is like writing in English while createElement is writing in assembly language. Both produce the same result, but one is designed for human brains.
The Pain Point
Imagine building a complex form or layout with dozens of nested elements—each one requiring a properly nested createElement call with correct parentheses. You'd spend more time managing syntax than building features.
Key Takeaway: JSX compiles to React.createElement() calls—writing components without JSX reveals why the syntax sugar exists: raw React API is functional but painfully verbose for real applications.