尝试加速编译

尝试加速编译

作者:


apps/link/src/main/index.tsx 这是项目的入口。

(尝试)用下面的代码直接渲染表单页面。

const search = '?billTypeId=ER3CCW52BV70002'
const queryParams: any = queryString.parse(search.replace('?', ''));
const fromId = queryParams['fromId'] || '';
const props = {
  mode: 'Edit',
  passParams: {},
  billTypeId: queryParams['billTypeId'],
  businessTypeId: queryParams['businessTypeId'],
  templateId: queryParams['templateId'],
  contextOrgIds: queryParams['contextOrgIds'],
  needOrgFieldStateControl: queryParams['needOrgFieldStateControl'] || '',
  fromEntityName: queryParams['fromEntityName'],
  fromIds: !fromId ? [] : fromId.split(',')
};
const presenter = new CalendarEntryFormPresenter({
  ...props,
});
const app = (<CalendarForm
  // componentRef={ref}
  presenter={presenter}
/>)
const render = Component => {
  ReactDOM.render(
    app
    // <Component client={client} store={store} metadata={metadata} />
    ,
    document.getElementById('root')!,
  );
};

render(App);