If you used this with Backbone, could you throw Backbone's entire View object away and use this instead?
React: Finally, a great server/client web stack
21–30 of 134 posts
Re: React: Finally, a great server/client web stack
#22> You can choose to use this, but after getting over my initial distaste for it ("Ack! Who got markup in my code!"), I could never go back to not using it. Or you could just use HTMLbars/Handlebars. Seems like "JSX" is just a more complicated version of a Mustache-esque logic-less template.
JSX + React produce functions that return React's representation of the DOM, their "virtual DOM", and React knows how to make small mutations based on state. If a change in state only needs to add a class 10 levels deep in the hierarchy, that is the only change that happens in the real DOM; it doesn't have to re-render the entire template.
Re: React: Finally, a great server/client web stack
#23If you used this with Backbone, could you throw Backbone's entire View object away and use this instead?
But you can also use your existing Backbone Views (if they have some nice, say, formatting or data-munging-for-display logic in them) and simply replace your render function with React.
The next step you can take is replacing your HTML templates with React's JSX templates, if you'd like...
Re: React: Finally, a great server/client web stack
#24> You can choose to use this, but after getting over my initial distaste for it ("Ack! Who got markup in my code!"), I could never go back to not using it. Or you could just use HTMLbars/Handlebars. Seems like "JSX" is just a more complicated version of a Mustache-esque logic-less template.
Re: React: Finally, a great server/client web stack
#25If you used this with Backbone, could you throw Backbone's entire View object away and use this instead?
Yes, and that's a great use case for it. But you can also use your existing Backbone Views (if they have some nice, say, formatting or data-munging-for-display logic in them) and simply replace your render function with React. The next step you can take is replacing your HTML templates with React's JSX templates, if you'd like...
I'm still up in the air on how I feel about the whole JSX thing but I'm willing to give it a try.
Re: React: Finally, a great server/client web stack
#26PLEASE JUST GIVE ME A STATIC PAGE WITH YOUR CONTENT.
I really do not care if the comments don't refresh live.
Re: React: Finally, a great server/client web stack
#27Earlier quoted context omitted.
JSX isn't markup - it's XML which translates to Reacts internal representation which looks something like: bar --> 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 ) ignores it.
"JSX isn't markup - it's [Extensible Markup Language]"?
> JSX transforms from an XML-like syntax into native JavaScript.
Re: React: Finally, a great server/client web stack
#28Re: React: Finally, a great server/client web stack
#29Am I the only one that kind of thinks most websites should just be static pages? Like, I get pretty irritated when I go to read a blog post on Medium or wherever and it loads a header and a blank page, and then loads a bunch of javascript (mostly tracking and analytics frameworks), and finally goes out and gets the actual content. And then if I scroll down, it has to load some more garbage from Disqus or something. P…
Re: React: Finally, a great server/client web stack
#30[deleted]