import React from 'react'
import Loadable from 'react-loadable'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

class LoadingPage extends React.Component {
  //类似github页面加载的那个加载条
  componentWillMount () {
    NProgress.start()
  }
  componentWillUnmount () {
    NProgress.done()
  }
  render () {
    return (
      <div />
    )
  }
}

var baseURL = 'http://52.83.169.190:8005'
var baseURL = 'http://52.83.169.190:8005'

const LoadableComponent = (component) => {
  return Loadable({
    loader: component,
    loading: () => <LoadingPage />
  })
}

export default LoadableComponent