How to use the react-tools/build/modules/React.renderComponent function in react-tools

To help you get started, we’ve selected a few react-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andreypopp / react-app / bootstrap.js View on Github external
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));
    });
}
github andreypopp / react-app / page.js View on Github external
function renderComponent(component, element, cb) {
  try {
    component = React.renderComponent(component, element);
  } catch (err) {
    return cb(err);
  }
  cb(null, component);
}
github petehunt / reactify-server-rendering / index.js View on Github external
clientRender: function(moduleName, props) {
    var module = require(moduleName);
    var component = module(props);
    React.renderComponent(component, document);
  }
};