3 ms·
It's automatic: http://jsfiddle.net/bD68B/ http://jsfiddle.net/bD68B/ I tried to make the example as minimal as possible, so I don't show off a lot of the fea
by peterhunt 12y ago
It's automatic:
http://jsfiddle.net/bD68B/ http://jsfiddle.net/bD68B/
I tried to make the example as minimal as possible, so I don't show off a lot of the features (i.e. state, event handling), but I did use JSX, an optional syntax extension for function calls.
- syntern 12y agoThank you, this seems to do it for the innerText. Would it be too hard to apply it to the class attribute too? (I've tried to just copy the {} binding, but it doesn't work)
- zenojevski 12y agoHere, I gave it a try: http://jsfiddle.net/bD68B/1/ http://jsfiddle.net/bD68B/1/
- danabramov 12y agoThere you go: http://jsfiddle.net/Q2KXu/1/ http://jsfiddle.net/Q2KXu/1/
- syntern 12y agoThank you both! I now have a much better understanding on how React works. I need to update the related performance benchmarks, it would be interesting to see how they compare side-by-side on our use cases.
- danabramov 12y agoDon't forget [PureRenderMixin][1], it can give a big perf boost when used in right places. [1]: http://facebook.github.io/react/docs/pure-render-mixin.html http://facebook.github.io/react/docs/pure-render-mixin.html