4 ms·
You definitely have to learn a DSL - in JSX you have to use className instead of class for the HTML tag property. There are a few other examples of this, but th
by acconrad 10y ago
You definitely have to learn a DSL - in JSX you have to use className instead of class for the HTML tag property. There are a few other examples of this, but the point is the argument doesn't hold water against Angular's templating language.
- botskonet 10y agoLearning a few differences for attributes names isn't nearly as involved as learning angular's entire custom attribute and syntax support though. I would also add that for any web app truly utilizing these libraries, you're going to have to know how they get compiled and where your data is coming from. With Angular you have to learn about scopes, digesting, linking/compiling, etc. Two-way binding was amazing to me when I first took up Angular, it made common tasks so easy but on an enterprise-level application it's a nightmare because you're quickly dealing with digest/event cycle issues, especially during automated testing. The control over data flow that React prefers makes the easy, common tasks more time consuming, but overall saves a massive amount of complexity.
- kentor 10y agoThe reason why it uses `className` is because we're in javascript land (https://developer.mozilla.org/en-US/docs/Web/API/Element/className https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...) So it's not a DSL when you really think about it. It's javascript.
- t3soro 10y agoclassName has always been the convention for accessing the class attribute in Javascript. https://developer.mozilla.org/en-US/docs/Web/API/Element/className https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...
- cri5ti 10y agoAnd that's of course because pre ES5 you couldn't use keywords (class) as property names.