mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
This covers most everything. The perf suite still needs work for the Element updates. And the server rendering example needs to be done wholesale.
26 lines
588 B
JavaScript
26 lines
588 B
JavaScript
if (typeof exports == 'undefined') exports = {};
|
|
|
|
/*http://benchmarkjs.com/docs#options*/
|
|
|
|
exports.name = 'shouldComponentUpdate';
|
|
|
|
exports.setup = function(){
|
|
var AwesomeComponent = React.createClass({
|
|
shouldComponentUpdate: function(){
|
|
return false;
|
|
},
|
|
render: function(){
|
|
return React.DOM.div({});
|
|
}
|
|
});
|
|
|
|
var _rootNode = document.createElement('div');
|
|
document.body.appendChild(_rootNode);
|
|
};
|
|
exports.fn = function(){
|
|
React.render(AwesomeComponent(null), _rootNode);
|
|
};
|
|
exports.teardown = function(){
|
|
React.unmountComponentAtNode(_rootNode);
|
|
};
|