Some of the popular libraries like
React allows developers to create components composed of data and UI. Having experience in both libraries we will compare both of them in this article.
The below table indicates a comparison between React and Polymer.
|Popularity (Number of GitHub Stars)||Star||Star|
|Server Side Rendering||No||Yes (with Node.js)|
|Compliant to Web Components standard||Yes||No.|
|Data Flow||Between parent and child components (two-way binding)||Only from parent to child component (one-way binding)|
|Support Channel||slack, stack overflow||discord, forum, stack overflow|
|Browser Support||Chrome (Native).
Firefox, Safari 9+, IE 11+, and Edge (Using polyfills)
|Chrome, Firefox, Safari, IE 9+, and Edge (By compiling ES6 to ES5)|
|Notable Sites Using||Google Translate Community, Google Music, EA, Divshot, Youtube Gaming||Facebook, Feedly, Fiverr, Flipkart, Instagram|
Which library should you use?
Polymer provides an easy way of creating custom components and adheres to Web Components standard wheres react takes advantage of its
virtual DOM implementation which renders the DOM blazing fast.
If you want to build future-proof apps that support modern browser, Polymer is your choice. If you want to build an app with rich data, you can go for React. Also check for the availability of community built components for React and Polymer, before starting to build it on your own.
Using Polymer components inside a React component and vice versa is practically possible, but not usually preferred. More information available about using Web Components within React is available in React documentation page.
Decided a library to use in your next project? Share your thoughts in the comments section below.