Hacker News new | past | comments | ask | show | jobs | submit login

React at it's core is a function (or set of functions) that interpret strings like "h1" into DOM elements in a browser.

JSX is a shorthand for writing those function calls. <h1> becomes React.createElement("h1"). Sure you are still largely using HTML element names, but that's only because people don't really use JSX for anything else. The whole point is that it's easier to write JSX than the underlying function calls.

You can use JSX to target things other than DOM by supplying your own function instead of React.createElement(). Here's an example of an express web-server using JSX: https://betterprogramming.pub/how-to-create-a-web-server-wit...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: