mirror of
https://github.com/facebook/react.git
synced 2026-02-24 20:53:03 +00:00
25 lines
688 B
JavaScript
25 lines
688 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.renderComponent single div';
|
|
|
|
exports.setup = function(){
|
|
/*global*/_rootNode = document.createElement('div');
|
|
document.body.appendChild(_rootNode);
|
|
};
|
|
exports.fn = function(){
|
|
React.renderComponent(React.DOM.div(null, 'lol, perf testing ', this.count), _rootNode);
|
|
};
|
|
exports.teardown = function(){
|
|
if (React.unmountAndReleaseReactRootNode) React.unmountAndReleaseReactRootNode(_rootNode);
|
|
else React.unmountComponentAtNode(_rootNode);
|
|
};
|