Live data from Hacker News

What should go into JSX 2.0?

github.com

11–20 of 102 posts

Re: What should go into JSX 2.0?

#13

Since when does Reason have JSX?

JSX is actually a generic transformation of XML like structures to function calls. Since it's mostly used with React, that's the default, but you can use any function you like. It's the "pragma" option in the config for the plugin.

https://babeljs.io/docs/plugins/transform-react-jsx/

Re: What should go into JSX 2.0?

#14

"What should go into JSX 2.0?" would be a much clearer title outside of the context of the GitHub issue.

Yup, even the issues not marked controversial seem so to me. I think JSX is quite nice but it has its limits/annoyances. One is obviously that it's not real HTML5. I would like to see a successor that is more like HTML5 without the X. No idea how that could be realized though... ;)

Sorry, what do you mean by this? (For those unfamiliar with the deviations)

Re: What should go into JSX 2.0?

#16
I like how the if proposal is down voted, probably because it's mentioning Angular. Conditional rendering in React is not always very clean. Most codebases end up resorting with something similar to this in a container to show a spinner while data is loading and rendering it when done.

Problem is that the inner component will still be parsed and fail with cannot read property person of undefined. Yes, you can do this with a simple condition in your render function, but then it's not declarative any more.

Re: What should go into JSX 2.0?

#17
post #16

I like how the if proposal is down voted, probably because it's mentioning Angular. Conditional rendering in React is not always very clean. Most codebases end up resorting with something similar to this in a container to show a spinner while data is loading and rendering it when done. Problem is that the inner component will still be parsed and fail with cannot read property person of undefined. Yes, you can do this…

How about { data && } ?

Re: What should go into JSX 2.0?

#18
post #16

I like how the if proposal is down voted, probably because it's mentioning Angular. Conditional rendering in React is not always very clean. Most codebases end up resorting with something similar to this in a container to show a spinner while data is loading and rendering it when done. Problem is that the inner component will still be parsed and fail with cannot read property person of undefined. Yes, you can do this…

[deleted]
Post reply on HN