content: import React from 'react'
  import PropTypes from 'prop-types'
  
  class Bundle extends React.Component {
    constructor(props) {
      super(props)
      this.state = {
        component: null,
      }
    }
  
    componentWillMount() {
      this.load(this.props)
    }
  
    componentWillReceiveProps(nextProps) {
      this.load(nextProps)
    }
  
    load(props) {
      props.component.then((component) => {
        this.setState({ component: component.default || component })
      })
    }
  
    render() {
      if (this.state.component) {
        return React.Children.only(this.props.children(this.state.component))
      }
      return null
    }
  }
  
  Bundle.propTypes = {
    children: PropTypes.func.isRequired,
  }
  
  export default Bundle
  