3 ms·
Well you can write pure JS instead of JSX if that helps. An example: https://github.com/ustun/react-without-jsx/blob/master/child.js#L6-L11 https://github.com/u
by owaislone 10y ago
Well you can write pure JS instead of JSX if that helps. An example: https://github.com/ustun/react-without-jsx/blob/master/child.js#L6-L11 https://github.com/ustun/react-without-jsx/blob/master/child...
- Roboprog 10y agoThanks. That actually looks better to me than JSX, and I would like to avoid transpiling JS in a pure web app. (disclosure: I've been an Angular 1 dev for a bit over a year and only skimmed some React material, but I have also done other stuff for the last 30 years)
- wayfarer2s 10y agoIt might look more familiar, but it's not better than JSX. It gets really tedious to write the pure JavaScript versions of components especially when specifying lots of attributes and nested components. It's also hard to follow. Everyone I've worked with on React projects has had similar initial reactions, it just looks weird to have html inside JS. But try it out first, I'm sure you'll grow accustomed to writing JSX and the tooling built around it.
- qudat 10y agoI disagree. I'm working on a large react project now and am not using JSX. I find JSX to be very ugly with all their closing div tags. Check out this project to see how people use React without JSX: https://github.com/jador/react-hyperscript-helpers https://github.com/jador/react-hyperscript-helpers