Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _renderPage(page, doc, cb) {
if (doc.readyState === 'interactive' || doc.readyState === 'complete')
cb(null, React.renderComponent(page, doc));
else
window.addEventListener('DOMContentLoaded', function() {
cb(null, React.renderComponent(page, doc));
});
}
function renderComponent(component, element, cb) {
try {
component = React.renderComponent(component, element);
} catch (err) {
return cb(err);
}
cb(null, component);
}
clientRender: function(moduleName, props) {
var module = require(moduleName);
var component = module(props);
React.renderComponent(component, document);
}
};