TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: React 0.12 renders to Web Components

45 点作者 OlavHN超过 10 年前

5 条评论

rictic超过 10 年前
This seems cool, but I&#x27;m a bit confused (background: I&#x27;ve been working with web components and polymer for the past couple of months, but have only read a couple articles on React, apologies if this is a dumb question).<p>This says that react renders to web components, but it looks to me like react is just adding a web component to the area of the DOM that it&#x27;s controlling. Is more going on here? e.g. doing the same thing with jquery:<p><pre><code> $(&#x27;&lt;core-icon&gt;&#x27;).attr(&#x27;src&#x27;, &quot;&#x2F;&#x2F;www.polymer-project.org&#x2F;images&#x2F;icons&#x2F;android.svg&quot;).appendTo(&#x27;#jquery-root&#x27;); </code></pre> Is the idea that React is doing data binding to the src attribute?
评论 #8573892 未加载
Bahamut超过 10 年前
How would data syncing work between React and the components seem to be a more important question. One doesn&#x27;t really need React to create a web component in this example.
bwhitty超过 10 年前
Polymer uses standard 2-way data binding. How does this fit into React&#x27;s flow? I&#x27;d love to see an implementation of Polymer using the Flux architecture.
评论 #8573350 未加载
评论 #8573201 未加载
miralabs超过 10 年前
I don&#x27;t get the advantage of this. What is the diff with $(&quot;&lt;core-icon&gt;&quot;)... call?
werdnapk超过 10 年前
Why does the icon src need to be specified twice?
评论 #8573214 未加载