Today was all about understanding how React really builds UI under the hood — going beyond the usual JSX and digging into how React.createElement() actually works.
What I Did Today
I created my own React element using React.createElement() instead of JSX.
Here’s how it works:
React.createElement('h1', { className: 'heading' }, 'Hello, world!')
Breakdown:
1.The first argument is the tag name (like 'h1')
2.The second is an object of attributes (just like props)
3.The third is the inner content (can be a string, expression, or even another element)
4.The Forth is for the Evaluated Expression which comes from variable
Top comments (0)