src/Morearty.js
function (rootComp, reactContext) {
      var ctx = this;

      var effectiveReactContext = reactContext || {};
      effectiveReactContext.morearty = ctx;

      return React.createClass({
        displayName: 'Bootstrap',

        childContextTypes: {
          morearty: React.PropTypes.instanceOf(Context).isRequired
        },

        getChildContext: function () {
          return effectiveReactContext;
        },

        componentWillMount: function () {
          ctx.init(this);
        },

        render: function () {
          var effectiveProps = Util.assign({}, {binding: ctx.getBinding()}, this.props);

          return React.createFactory(rootComp)(effectiveProps);
        }
      });
    }
function (rootComp, reactContext) {
      var ctx = this;

      var effectiveReactContext = reactContext || {};
      effectiveReactContext.morearty = ctx;

      return React.createClass({
        displayName: 'Bootstrap',

        childContextTypes: {
          morearty: React.PropTypes.instanceOf(Context).isRequired
        },

        getChildContext: function () {
          return effectiveReactContext;
        },

        componentWillMount: function () {
          ctx.init(this);
        },

        render: function () {
          var effectiveProps = Util.assign({}, {binding: ctx.getBinding()}, this.props);

          return React.createFactory(rootComp)(effectiveProps);
        }
      });
    }
function ( rootComp , reactContext ) { var ctx = this ; var effectiveReactContext = reactContext || { } ; effectiveReactContext . morearty = ctx ; return React . createClass ( { displayName : 'Bootstrap' , childContextTypes : { morearty : React . PropTypes . instanceOf ( Context ) . isRequired } , getChildContext : function ( ) { return effectiveReactContext ; } , componentWillMount : function ( ) { ctx . init ( this ) ; } , render : function ( ) { var effectiveProps = Util . assign ( { } , { binding : ctx . getBinding ( ) } , this . props ) ; return React . createFactory ( rootComp ) ( effectiveProps ) ; } } ) ; }
Create Morearty bootstrap component ready for rendering.
@param {*} rootComp root application component
@param {Object} [reactContext] custom React context (will be enriched with Morearty-specific data)
@return {*} Morearty bootstrap component
Create Morearty bootstrap component ready for rendering .