Show HN: React 0.12 renders to Web Components
gist.github.com
Show HN: React 0.12 renders to Web Components
1–10 of 11 posts
Re: Show HN: React 0.12 renders to Web Components
#2Re: Show HN: React 0.12 renders to Web Components
#3Re: Show HN: React 0.12 renders to Web Components
#4Re: Show HN: React 0.12 renders to Web Components
#5Polymer uses standard 2-way data binding. How does this fit into React's flow? I'd love to see an implementation of Polymer using the Flux architecture.
Re: Show HN: React 0.12 renders to Web Components
#6Why does the icon src need to be specified twice?
IDK why the OP decided to name the variable `div`. It'd have been much clearer if it was named something like `reactIcon`.
Re: Show HN: React 0.12 renders to Web Components
#7Why does the icon src need to be specified twice?
It isn't. There are two icons on the page (to show they are identical). Look in Web Inspector - only one is in #react-root. IDK why the OP decided to name the variable `div`. It'd have been much clearer if it was named something like `reactIcon`.
Re: Show HN: React 0.12 renders to Web Components
#8Polymer uses standard 2-way data binding. How does this fit into React's flow? I'd love to see an implementation of Polymer using the Flux architecture.
For example, say you have a custom select box. You don't want to fire a flux action when a user clicks on an option. You want that click to be handled by your select component, and be interpreted as an intent to change the value. Your select component then triggers its onChange (or onSelect, doesn't really matter) callback if it has one. The parent of the select component is then responsible for saying "actually the rest of the page should know about this value change, i'll trigger a flux action".
The end result is that your reusable widgets/components have no knowledge of flux, but the implementation of a particular page or piece of functionality does.
Re: Show HN: React 0.12 renders to Web Components
#9This 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's controlling. Is more going on here? e.g. doing the same thing with jquery:
$('').attr('src', "//www.polymer-project.org/images/icons/android.svg").appendTo('#jquery-root');
Is the idea that React is doing data binding to the src attribute?