|
|
|
|
|
by Offler
3939 days ago
|
|
Mithril appears harder to read than equivalent JSX. const links = ctrl.pages().map(page => <a href={page.url}>{page.title}</a>); return <div>
{links}
<button onClick={ctrl.rotate}>
Rotate Links
</button>
</div>; Compared to m("div", [
ctrl.pages().map(function(page) {
return m("a", {href: page.url}, page.title);
}),
m("button", {onclick: ctrl.rotate}, "Rotate links")
]);
I can see what the UI will be with JSX at a glance with Mithril I have to parse the code.edit: Mind you both look awful due to HNs poor formatting ability. Honestly how did this website become so popular with tech people? |
|
React:
Mithril: There are JSX equivalents for Mithril too (for both Babel and standalone JSX).Mithril templates look also very good in CoffeeScript and similar languages.