react/perf/tests/renderComponent-basic.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

25 lines
670 B
JavaScript

/* jshint undef: true, unused: true */
/* global document */
/* global window */
/* global Benchmark */
/* global React */
if (typeof exports == 'undefined') exports = {};
/*http://benchmarkjs.com/docs#options*/
exports.name = 'React.render single div';
exports.setup = function(){
/*global*/_rootNode = document.createElement('div');
document.body.appendChild(_rootNode);
};
exports.fn = function(){
React.render(React.DOM.div(null, 'lol, perf testing ', this.count), _rootNode);
};
exports.teardown = function(){
if (React.unmountAndReleaseReactRootNode) React.unmountAndReleaseReactRootNode(_rootNode);
else React.unmountComponentAtNode(_rootNode);
};