Commit 8a15e9bd authored by WhatAKitty's avatar WhatAKitty Committed by ddcat1115

fix error while using react-script (#516)

parent 3683e0dd
...@@ -11,7 +11,8 @@ const dynamicWrapper = (app, models, component) => dynamic({ ...@@ -11,7 +11,8 @@ const dynamicWrapper = (app, models, component) => dynamic({
component: () => { component: () => {
const p = component(); const p = component();
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
p.then((Comp) => { p.then((raw) => {
const Comp = raw.default || raw;
resolve(props => <Comp {...props} routerData={getRouterData(app)} />); resolve(props => <Comp {...props} routerData={getRouterData(app)} />);
}).catch(err => reject(err)); }).catch(err => reject(err));
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment