帮酷LOGO
  • 显示原文与译文双语对照的内容
A higher order component for loading components with promises.

  • 源代码名称:react-loadable
  • 源代码网址:http://www.github.com/jamiebuilds/react-loadable
  • react-loadable源代码文档
  • react-loadable源代码下载
  • Git URL:
    git://www.github.com/jamiebuilds/react-loadable.git
  • Git Clone代码到本地:
    git clone http://www.github.com/jamiebuilds/react-loadable
  • Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/jamiebuilds/react-loadable
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
  • React Loadable

    一个高阶组件,用于加载动态导入。

    安装

    yarn add react-loadable

    示例

    importLoadablefrom'react-loadable';importLoadingfrom'./my-loading-component';constLoadableComponent=Loadable({
     loader: () =>import('./my-component'),
     loading: Loading,
    });exportdefaultclassAppextendsReact.Component {
     render() {
     return<LoadableComponent/>;
     }
    }

    快乐客户:




    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语