4 ms·
It depends on what kind of website or web app you are working on. I noticed that polymer is not really suitable for highly dynamic web applications. With React
by wereHamster 12y ago
It depends on what kind of website or web app you are working on.
I noticed that polymer is not really suitable for highly dynamic web applications. With ReactJS you can use all of the javascript control structures (if/then/else, conditions, loops, functions etc). With polymer you are restricted to bind, repeat and ref, which are not enough to adequately cover the requirements of a complex application.
My recomendation is to use polymer if it's a mostly static website with just a few moving parts, and ReactJS otherwise.
- dfreedm2 12y agoPolymer has if (not else yet), repeats loops, functions, and expressions: http://www.polymer-project.org/docs/polymer/expressions.html http://www.polymer-project.org/docs/polymer/expressions.html
- spankalee 12y agoPolymer is used to build very complex applications. Not only do Polymer templates have bind, if, repeat, and ref, which are enough to cover the _vast_ majority of cases, by they work by binding to an expression which can drive more complex behavior. I'm curious what you think you can't do with Polymer templates?
- wereHamster 12y agoI didn't say polymer can't do it. What I'm saying is that certain constructs are more difficult to write in polymer. Or involve more code and indirection. Most apps will have their core data loaded into nice JavaScript objects and class instances. With react the transformation of that data into DOM is a one step process. With polymer you have to first map that data to javascript primitives which are consumed by expressions which then generate the DOM. I guess ultimately it's my preference to having types (I use TypeScript) which can be used inside the rendering code to ensure correctness. With polymer you lose some of that because everything ends up in these untyped expressions.