app.tsx 634 Bytes
import { ConfigProvider } from 'antd';
import { ReactNode } from 'react';
import pkg from '../package.json';

const { name } = pkg;

/**
 * @see  https://v3.umijs.org/zh-CN/plugins/plugin-initial-state#getinitialstate
 * */
export async function getInitialState(): Promise<{}> {
  return window.qx.getModuleData();
}

/**
 * @see https://v3.umijs.org/zh-CN/docs/runtime-config#rootcontainerlastrootcontainer-args
 */
export function rootContainer(container: ReactNode) {
  return (
    <ConfigProvider
      getPopupContainer={() => document.getElementById(name) || document.body}
    >
      {container}
    </ConfigProvider>
  );
}