3 ms·
I hated JSX when it first came out and thought React wouldn't take off because of it, then I used React for 5 years, and I still hate JSX. I write all my compo
by erlich 6y ago
I hated JSX when it first came out and thought React wouldn't take off because of it, then I used React for 5 years, and I still hate JSX.
I write all my components like this:
const props = {foo: 1, bar: 1}
<MyComponent {...props}>
{children()}
</MyComponent>
function children() { return foos.map(b => <div>{b}</div>) }
Why do I have to use a weird language with non-standard JS stuff. Writing conditionals in JSX is horrible, and props are unnecessarily verbose when we have ES6 language features like structuring.
It could easily be just a nested tree structure.