by arcosdev · 7y ago · 0 comments
React.createElement(
"div",
null,
React.createElement(
"div",
null,
React.createElement(
"p",
null,
React.createElement(
"a",
{ href: "foo" },
"Link"
)
)
)
);
document.getElementById('root')
); import {createElement as h} from 'react'
import {render} from 'react-dom'
render(
h('div', null,
h('div', null,
h('p', null,
h('a',
{href:'foo'},
'Link',
),
),
),
),
document.getElementById('root')
) div([
div([
p([
a({ href: "foo" }, "Link")
])
])
])
[1] https://reactjs.org/docs/react-without-jsx.htmlI guess react-hyperscript is what I was looking for, but I've grown to quite like JSX.