All files / ima/page/renderer BlankManagedRootView.js

25% Statements 2/8
0% Branches 0/2
0% Functions 0/3
25% Lines 2/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40        5x                                                                   5x  
import PropTypes from 'prop-types';
import React from 'react';
import ns from '../../namespace';
 
ns.namespace('ima.page.renderer');
 
/**
 * Blank managed root view does not nothing except for rendering the current
 * page view.
 *
 * This is the default managed root view.
 */
export default class BlankManagedRootView extends React.Component {
  static get propTypes() {
    return {
      $pageView: PropTypes.func
    };
  }
 
  static get defaultProps() {
    return {
      $pageView: null
    };
  }
 
  /**
	 * @inheritdoc
	 */
  render() {
    let pageView = this.props.$pageView;
    if (!pageView) {
      return null;
    }
 
    return React.createElement(pageView, this.props);
  }
}
 
ns.ima.page.renderer.BlankManagedRootView = BlankManagedRootView;