
React v0.11 - sophiebits
http://facebook.github.io/react/blog/2014/07/17/react-v0.11.html
======
HorizonXP
I just started using React on my project this week. It's incredibly easy to
use and get running, I'm loving it. It's really simplified my UI development.
The UI for my project is something I need to just get done for now, while I
build out the rest of the functionality. I'll come back later to make it
prettier. But React makes that super easy to do.

Wish I'd talked to the guys at FB about it more before I left.

------
fidlefodl
Anyone have any opinion on React vs Polymer?

It's something i've been struggling with quite a bit. Conceptually i love
Polymer, and really want to switch, but React's serverside rendering is just
hard to beat. I'm scared of showing users page load spinners while my 20
Polymer components all load their data heh

~~~
spicyj
I'd love to know what you love about Polymer so we can make React better. :)

~~~
fidlefodl
Well, as unhelpful as this.. I love everything about Polymer, _except_ the
possible HTTP request spam and lack of serverside rendering.

Polymer is sort of React Components "To the extreme" (to me). They represent
everything i love about React Components, with encapsulated JS, CSS, and HTML.
Meaning that i can pull in someone elses Polymer component, or use one from
another project, and it "just works".

Granted, the HTTP spam scares the hell out of me. Vulcanize may help with
that, but i have yet to really figure out the whole process for my workflows.

Having to load an html wrapper, do clientside routing, load the data into the
clientside templates and render templates all for the first page load just
scares me with Polymer. React solves this by letting me do it all serverside,
and it is wonderful at that.

I really do love React. I'll likely stick with React for another project or
two, unless i conceptually have an "ah hah" moment with Polymer.. but until i
can render Polymer serverside, i'll always be longing for React.

 __edit __: Come to think of it.. If someone could bake html imports and
shadow dom into React, i may be in heaven.

~~~
peterhunt
React already can render into shadow roots, and eventually we could add a mode
that tosses aside server rendering in favor of shadow DOM. However, if all you
want is style encapsulation, you can get that with conventions.

------
arianvanp
Great stuff. I really love React. Especially stuff like server-side
prerendering of the DOM is extremely cool.

~~~
swah
But that assumes a world where everyone uses Node :)

~~~
swannodette
React server side rendering doesn't require Node. Works just fine with Java
8's Nashorn too.

~~~
fiatjaf
It works with CouchDB too: [https://github.com/fiatjaf/reactive-
couch](https://github.com/fiatjaf/reactive-couch)

------
bgdam
I have been trying to use React in an application I am building. One recurring
issue I have with React is child to parent component communication. The
recommended way seems to be to have the child component emit events which are
then caught and handled by the parent component.

Unfortunately, this approach does not work very well in the cases where I have
multiple instances of the same component, in which case all the parents will
be recieving and handling the event emitted by a single child. I would love to
hear any possible solutions for this that do not involve either registering
unique event names for each instance of the component or passing in a unique
id as part of the event payload, which is then verified by the handler
function.

~~~
insin
The docs recommend passing a callback for parent-child communication:

[http://facebook.github.io/react/tips/communicate-between-
com...](http://facebook.github.io/react/tips/communicate-between-
components.html)

------
grannyg00se
What a great site for reading. I'm not usually into design, but reading
through that blog forced me into a new appreciation for layout, font, and
color.

------
ChikkaChiChi
I planned on using React for my next mobile app project until Polymer was
shown off at I/O. React is a fantastic alternative to Angular, but the Paper
Elements make Polymer too good to pass up.

I would be over the moon if React had a UI Kit that could be included. We need
more app-centric first UI options for rapid development.

~~~
planckscnst
Try the paper elements demo [1] in Firefox mobile before finalizing that
choice. It's pretty maddening.

[1] [http://www.polymer-project.org/components/paper-
elements/dem...](http://www.polymer-project.org/components/paper-
elements/demo.html#paper-input)

~~~
bsaul
Or on an ipad. It doesn't work very well and even crashed my ipad air. I'll
definitely not use it for a webapp.

------
megaman821
Does everyone just use Backbone.js with React, or are there other models,
routers, and controllers that people use?

~~~
fattenap
I created imvvm
[https://github.com/entrendipity/imvvm](https://github.com/entrendipity/imvvm)
. It uses the Model-View-ViewModel pattern with React as the View

~~~
fattenap
It also has pushState routing built in

------
tete
Is it only me or does that remind anyone else about basic MVC frameworks, like
Backbone used properly?

Oh and don't get me wrong that this pattern gets used again. I can see it
being extended here and it looks really nice and promising. I just don't
understand the sudden hype.

~~~
theycallmemorty
React is not meant to replace something like Backbone, it is only the 'V' in
MVC although you could argue it is also the C.

React does not ship with any code for saving your data to the server.

------
islon
And the best thing is that I can use react with Clojurescript (Om), which
makes it even faster =)

------
asdad
Has anyone written a large React application yet? Preferably open source?

~~~
stevejohnson
Literally Canvas uses React for its GUI:
[http://literallycanvas.com](http://literallycanvas.com)

It isn't using JSX yet because CoffeeScript integration didn't exist until
recently, but it was still a joy to use.

~~~
nacs
If you hold the mouse down and drag off-canvas to the left or bottom sides,
the painting cursor shoots up to y = 0 and leaves a streak.

~~~
stevejohnson
Thanks for the bug report. I've saved it in the GitHub issue tracker. Pretty
weird behavior, definitely fixable.

------
rubiquity
Wooohoo! Nice release. I especially like the JSX Namespacing! I sometimes
found myself sacrificing better organization/naming just so my component
rendering code wasn't so hideous.

~~~
spicyj
We still recommend exporting small modules internally in your code base so
that things are easier to reason about and dead code elimination can work
better -- but when interfacing with third-party libraries, the namespacing
feature can be helpful. :)

------
Touche
Why React and not Mithril?

~~~
fiatjaf
I seems to me that Mithril is inspired by React, and it's awesome that someone
is trying to make things better than React.

That said, I have a bad impression of Mithril, because, in any case, its
author should bear some respect to React, as a son to his father. But,
instead, he appears very arrogant when talking about React (look here:
[http://lhorie.github.io/mithril/comparison.html#react](http://lhorie.github.io/mithril/comparison.html#react))
as if it was React that was inspired by Mithril and was reimplement Mithril
ideas with worse performance.

That bad impression, caused just by words (and other comments from its author
here), pulls me away from Mithril, which is a situation I don't love.

~~~
fuzzythinker
I actually think that comparison is fair. Don't read as a negative towards
React at all.

------
bellerocky
Inline JSX is such a stupid idea, and react.js doubles down on stupid. Why do
this? The documentation never explains why it is good to add some invalid
JavaScript syntax to a library. I want my templates in the same file as my
JavaScript logic, inline no less, peppered throughout variable declarations
and function calls all over the place, like I want to stub my toe. I do not
want to stub my toe and I don't want to use JSX. Notice the complete lack of
support in Webstorm.

~~~
fiatjaf
I agree. It is ugly. It must be because of HTML reuse or something.

But you should try writing React templates in pure Coffeescript[1], perhaps
reusing your HTML through a tiny tool[2] I wrote for it.

[1]: [http://blog.vjeux.com/2013/javascript/react-
coffeescript.htm...](http://blog.vjeux.com/2013/javascript/react-
coffeescript.html)

[2]: [http://html2react.alhur.es/](http://html2react.alhur.es/)

------
fiatjaf
"Update: New $apply command to transform values"

What is that? No, no, no, stop that! You're becoming Angular!

~~~
WickyNilliams
That's referring to an immutability helper, not like angular at all

------
fiatjaf
Every night when I close my eyes I envision a future in which React surpasses
HTML and browsers start to only render REACT code, documents are written and
named index.react, amateurish people say they are REACT programmers and
everything is so beautiful that you can't stop looking.

_________

Now seriously: there should be a way to turn React from a library to a DSL
that could be rendered by any language, so all servers, not only Node, could
generate their pages in React and pass them to the browsers.

Event handling could still be javascript, as servers don't need them, but code
that rendered elements according to specific this.props should be universal.

