{"size": 782, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "scrnhq/react-snapshot", "max_stars_repo_stars_event_min_datetime": "2017-02-23T16:37:18.000Z", "max_stars_repo_stars_event_max_datetime": "2018-01-03T13:55:25.000Z", "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "scrnhq/react-snapshot", "max_issues_repo_issues_event_min_datetime": "2017-02-23T16:40:58.000Z", "max_issues_repo_issues_event_max_datetime": "2017-02-27T11:58:40.000Z", "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "scrnhq/react-snapshot-server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 26.0666666667, "max_line_length": 71, "alphanum_fraction": 0.7020460358}
'use strict'; // eslint-disable-line

var React = require('react');
var ReactDOM = require('react-dom');

/**
 * Render the component passed in.
 * If the environment is JSDom, we expose the AppComponent so that
 * we can render it to a string & pass in the initial props.
 *
 * If the environment is a regular browser, we just render it.
 *
 * @param  {ReactComponent} AppComponent
 * @param  {Node} DOMElement
 * @return {void}
 */
function render(AppComponent, DOMElement) {
  if (navigator.userAgent.match(/Node\.js/i)) {
    window.app = AppComponent;
  } else {
    var initialProps = window.__INITIAL_PROPS__;
    var AppWithProps = React.createElement(AppComponent, initialProps);
    ReactDOM.render(AppWithProps, DOMElement);
  }
}

module.exports = {
  render: render
};
