2015-02-13 04:48:11 +08:00
|
|
|
if (typeof exports === 'undefined') {
|
|
|
|
|
exports = {};
|
|
|
|
|
}
|
2013-12-17 13:25:05 +08:00
|
|
|
|
|
|
|
|
/*http://benchmarkjs.com/docs#options*/
|
|
|
|
|
|
2014-10-23 09:30:11 +08:00
|
|
|
exports.name = 'React.render single div';
|
2013-12-17 13:25:05 +08:00
|
|
|
|
2015-02-13 04:48:11 +08:00
|
|
|
exports.setup = function() {
|
|
|
|
|
_rootNode = document.createElement('div');
|
2013-12-17 13:25:05 +08:00
|
|
|
document.body.appendChild(_rootNode);
|
|
|
|
|
};
|
2015-02-13 04:48:11 +08:00
|
|
|
exports.fn = function() {
|
2014-10-23 09:30:11 +08:00
|
|
|
React.render(React.DOM.div(null, 'lol, perf testing ', this.count), _rootNode);
|
2013-12-17 13:25:05 +08:00
|
|
|
};
|
2015-02-13 04:48:11 +08:00
|
|
|
exports.teardown = function() {
|
|
|
|
|
if (React.unmountAndReleaseReactRootNode) {
|
|
|
|
|
React.unmountAndReleaseReactRootNode(_rootNode);
|
|
|
|
|
} else {
|
|
|
|
|
React.unmountComponentAtNode(_rootNode);
|
|
|
|
|
}
|
2013-12-17 13:25:05 +08:00
|
|
|
};
|