You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
634 B

import React from 'react';
import { _DvaContainer, getApp, _onCreate } from './dva';
export function rootContainer(container) {
return React.createElement(_DvaContainer, null, container);
}
{{#SSR}}
export const ssr = {
modifyGetInitialPropsCtx: async (ctx) => {
// constructor onCreate
if (process.env.__IS_SERVER && ctx.history) {
const tmpApp = _onCreate({
// server
history: ctx.history,
})
tmpApp.router(() => {})
tmpApp.start();
}
// app
const { _store } = getApp();
ctx.store = _store;
return ctx;
},
}
{{/SSR}}