3 ms·
JSX isn't markup - it's XML which translates to Reacts internal representation which looks something like: <div className='foo'>bar</div> --> React.DOM.div({
by squidsoup 13y ago
JSX isn't markup - it's XML which translates to Reacts internal representation which looks something like:
<div className='foo'>bar</div> -->
React.DOM.div({
className: 'foo',
children: 'bar'
})
You don't have to use it - it's a convenience provided for designers (and arguably developers who have realised that templating provides a false separation of concerns). Om notably (https://github.com/swannodette/om https://github.com/swannodette/om) ignores it.
- nacs 13y ago"JSX isn't markup - it's [Extensible Markup Language]"?
- rakoo 13y agoJSX isn't markup, it's a compiler that transforms common HTML-like to custom React.DOM objects. From the doc [0]: > JSX transforms from an XML-like syntax into native JavaScript. [0] http://facebook.github.io/react/docs/jsx-in-depth.html http://facebook.github.io/react/docs/jsx-in-depth.html
- squidsoup 13y agoSorry, to be clearer, I meant it isn't HTML.