NueJS: “It’s just HTML!”
The HTML: <button @click=“count++”> {count} </button>
The HTML: <button @click=“count++”> {count} </button>
return (
<div>
<h2>You clicked {count} times!</h2>
<button onClick={() => setCount(count - 1)}>
Decrement
</button>
<button onClick={() => setCount(count + 1)}>
Increment
</button>
</div>
)
Nue is the opposite side of the same coin. return el("div", { children: [
el("h2", { children: [safe`You clicked ${count} times!`]) },
el("button", { onClick: () => setCount(count - 1), children: [safe`Decrement`] }),
el("button", { onClick: () => setCount(count + 1), children: [safe`Increment`] })
]});
The "it's just javascript" part comes from having no hidden getters, setters or proxies littered in code that may or may not behave as how we expect, and not littering the html with react-specific attributes for iteration, events, etcIn any case, why market your framework with an equally poor comparison?
You can use all React features without any special tooling.
React is just JavaScript. React+JSX is JSX. This:
<button onClick={() => setCount(count + 1)}>{count}</button>
Is sugar for: React.createElement('button', { onClick: () => setCount(count + 1) }, count)
True, the JSX version is most popular, but it's trivial syntax sugar with no "magic." This is different then Angular, Vue, Svelte, etc templates