Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.64 KB

API.md

File metadata and controls

46 lines (30 loc) · 1.64 KB

Table of Contents

AsyncComponent

src/components/AsyncComponent.js:21-88

Extends Component

异步组件

Parameters

  • props

Examples

import AsyncComponent from 'react-async-component'

<AsyncComponent
    components={[
        System.import('./A.js')
    ]}>
    {ModuleA=>{
        return <ModuleA/>
    }}
</AsyncComponent>

propTypes

src/components/AsyncComponent.js:30-35

propTypes

Properties

  • components Array components,使用System.import(webpack 4建议使用import的方式引用,需要使用babel插件babel-plugin-syntax-dynamic-import)进行引用,也可以使用同步的方式引用,如:require('xxx').default
  • children Function 异步回调
  • renderLoading Function?
  • renderError Function? renderError包含一个参数