3 ms·
> the mess of HTML and CSS get in the way of frameworks instead of helping them I totally understand where the author is coming from, and do agree... BUT there
by jordanlev 12y ago
> the mess of HTML and CSS get in the way of frameworks instead of helping them
I totally understand where the author is coming from, and do agree... BUT there is a flip side to this, which is that HTML and CSS enable us to come up with and implement totally unique designs and interfaces. The lack of standard layout and complex "widgets" is definitely a pain in the ass, but it also enables a lot of unique-looking websites and designs. It's kind of a pet peeve of mine when platforms/CMS's try to output markup instead of just providing data to the view layer... they are always outputting the "best practice" (if lucky) at the time they were built, and then a year or two later you want to do things a different way and you're stuck.
So I'm super excited about React.js and love the simple mental model with flux etc., but another part of me also worries that one can't dictate the markup exactly the way one wants because it has to be recognizable to the virtual dom as well (or the iOS view in native, or whatever other front-end React will output to).
Maybe someone with more React.js experience can enlighten me about this though? (I've only dabbled).
- danabramov 12y ago>one can't dictate the markup exactly the way one wants because it has to be recognizable to the virtual dom as well I'm not sure what you mean. On the opposite, with React, you specify exactly the DOM (or UIView) tree you want to get. You will build different components for React web and React Native, there's no common ground between them. The platforms are too different.
- jordanlev 12y agoI can't seem to find it now, but I remember seeing something a few months back about support for some HTML tag being added to react. I could be wrong about that, though (which would be great). I guess my question is this: can React/JSX render any kind of well-formed arbitrary markup? Like if next week there is a <doohickey> html tag I want to use, will it work? Or would react have to be updated to "support it" somehow?
- danabramov 12y ago>I remember seeing something a few months back about support for some HTML tag being added to react. It's just due to React <=0.12 using an HTML tag whitelist to tell native tags from custom components. It's not an issue anymore in 0.13, where any HTML tag (including custom Web Components) will work: https://github.com/facebook/react/pull/2830 https://github.com/facebook/react/pull/2830 There's still an attribute whitelist, and that's a trickier problem to solve: https://github.com/facebook/react/issues/140 https://github.com/facebook/react/issues/140
- jordanlev 12y agoAh, that makes sense. Thanks!