react/perf/tests/shouldComponentUpdate.js
Paul O’Shannessy f53854bd93 React.renderComponent -> React.render
This covers most everything. The perf suite still needs work for the
Element updates. And the server rendering example needs to be done
wholesale.
2014-10-23 20:51:11 -07:00

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);
};