Re:“Implement text editor DOM updates manually instead of vi...
by tootie on Friday February 27, 2015 @10:18AM
(#9119254)
JSX is XML and it can cause some confusion. For instance the fact that you can only have one root node is not obvious.
Re:“Implement text editor DOM updates manually instead of vi...
by j42 on Friday February 27, 2015 @10:51AM
(#9119463)
I will say though that when it comes to abstracting elements, this behavior seems to be implicit across the board (angular directive templates require the same, though they include a somewhat-informative error state).
As someone who has only begun to feel out React/JSX after developing some large, semi-complex enterprise UI's in Angular (with the respective back-end, usually an abstracted REST API) I'm finding the React model to be a lot more intuitive and scalable.
Angular is fantastic until you run up against problems with complex tasks that either must run outside of the digest loop or require manual control of painting/rendering to compensate for the abysmal binding performance.
Re:“Implement text editor DOM updates manually instead of vi...
by ceedan on Friday February 27, 2015 @12:41PM
(#9120143)
It is obvious, because when you use a component, it's usage is as a single root node.
<component /> should not render multiple root nodes.
Re:“Implement text editor DOM updates manually instead of vi...
by tootie on Saturday February 28, 2015 @04:49PM
(#9125182)
return <h2>label</h2><SubComponent />;
That's illegal and will fail to compile and it's not obvious why that should happen.
And on installing things, it is basically what any developer does these days. We install tools for almost anything. Just think of the JSX tools as another tool in your belt to help with the translation. The paradigm shift opens up your palette to new technologies. For instance, you can go from using just JSX to using ES6 with JSX (babeljs) as well, with no added cost, all because you already have your build process set up.