Commit b27bf8de authored by afc163's avatar afc163

Fix unneccessary rerender of parent page, close #525

parent c148b641
...@@ -10,10 +10,11 @@ const dynamicWrapper = (app, models, component) => dynamic({ ...@@ -10,10 +10,11 @@ const dynamicWrapper = (app, models, component) => dynamic({
// add routerData prop // add routerData prop
component: () => { component: () => {
const p = component(); const p = component();
const routerData = getRouterData(app);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
p.then((raw) => { p.then((raw) => {
const Comp = raw.default || raw; const Comp = raw.default || raw;
resolve(props => <Comp {...props} routerData={getRouterData(app)} />); resolve(props => <Comp {...props} routerData={routerData} />);
}).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