DEV Community

Ido Samuelson
Ido Samuelson

Posted on

A thought I had..

What was the reason react decided to create a jsx syntax rather use something like this:

const h1 = (str) => <h1>{str}</h1>;
const h2 = (str) => <h2>{str}</h2>;
const div = (arr) => <div>{arr}</div>;

const world = "world!"

const pureReactElement = div([
    h1("hello "),
    h2(world)
]);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)