Well, they both have different goals, and at some point they may even cross.
The Polymer aims to encapsulate html, js and css using the spec of import of . html, shadow gift and web components.
Import html file (html import)
ex: Adding an html menu to a site without html import:
<link rel="stylesheet" href="menu.css">
<script type="text/javascript" src="menu.js"></script>
<div class="menu">...</div>
ex: Adding the same menu with html import
<link rel="import" href="menu.html">
It’s actually quite simple, by importing the html file we can create a page ( like in the ex. menu.html ) and make it import html, css and js from Manu.
With this, just import the page to use the component ( html element ) and it imports the other files.
Shadow DOM
The DOM shadow creates a new context for the component by separating it from the page context, so you don’t need to worry for example id or out-of-context css collisions.
So when creating an element with ID 'item', do not worry about having another element with that same ID inside the page where the component will be rendered.
HTML component (web Component)
The short form html component is a way to encapsulate component creation through html tags.
Instead of having to create html and then run javascript:
<div id="menu"></div>
$("#menu").criaMenu({});
Just register the component and then call the tag.
<meuMenu />
O React in turn, has no concern (at least for the time being) of organizing your files using html import or creating web Components.
The goal of React is to create html/javascript components and render it performatively in the browser using the virtual DOM.
The Virtual DOM is a diff mechanism, which makes all the html manipulation happen in memory before being rendered in the DOM, making it possible to check what has already been created and change only what has been changed.
a very similar question was made Stack Over Flow and was closed because it was based solely on opinions.
– RafaelTheodoro
Rafael, I got to this link, but I was very confused, in short, I just wanted to know if they have very different, or has the same goal, which is to create web
– Rod
Rod, one of the comments has a link, where the person claims to have posted the answer, is here. Maybe it’ll help!
– RafaelTheodoro
Answer from him, it is very tedious, he only complains about reactjs and being beautiful or ugly to jhx writing
– Rod