Home > @elux/react-web > createApp

createApp() function

创建应用(CSR)

Signature:

export declare function createApp(appConfig: AppConfig): EluxApp;

Parameters

ParameterTypeDescription
appConfigAppConfig应用配置

Returns:

EluxApp

返回包含render方法的实例,参见RenderOptions

Remarks

应用唯一的创建入口,用于客户端渲染(CSR)。服务端渲染(SSR)请使用createSSR()

Example

createApp(config)
.render()
.then(() => {
  const initLoading = document.getElementById('root-loading');
  if (initLoading) {
    initLoading.parentNode!.removeChild(initLoading);
  }
});