mirror of
https://github.com/facebook/react.git
synced 2026-02-25 21:55:00 +00:00
26 lines
597 B
JavaScript
26 lines
597 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.renderComponent(AwesomeComponent(null), _rootNode);
|
|
};
|
|
exports.teardown = function(){
|
|
React.unmountComponentAtNode(_rootNode);
|
|
};
|