mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Merge pull request #3520 from Grimones/fix-preview-render-order
Fix render order in preview
This commit is contained in:
commit
3539625d7f
2
app/angular/src/client/preview/render.js
vendored
2
app/angular/src/client/preview/render.js
vendored
@ -1,6 +1,6 @@
|
||||
import { renderNgApp } from './angular/helpers';
|
||||
|
||||
export default function render({ story, showMain }) {
|
||||
renderNgApp(story);
|
||||
showMain();
|
||||
renderNgApp(story);
|
||||
}
|
||||
|
@ -21,6 +21,6 @@ export default function renderMain({ story, selectedKind, selectedStory, showMai
|
||||
return;
|
||||
}
|
||||
|
||||
m.mount(rootEl, { view: () => m(element) });
|
||||
showMain();
|
||||
m.mount(rootEl, { view: () => m(element) });
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ export default function renderMain({ story, selectedKind, selectedStory, showMai
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
showMain();
|
||||
if (typeof component === 'string') {
|
||||
rootElement.innerHTML = component;
|
||||
} else if (component instanceof TemplateResult) {
|
||||
@ -28,5 +30,4 @@ export default function renderMain({ story, selectedKind, selectedStory, showMai
|
||||
rootElement.innerHTML = '';
|
||||
rootElement.appendChild(component);
|
||||
}
|
||||
showMain();
|
||||
}
|
||||
|
@ -43,6 +43,6 @@ export default function renderMain({ story, selectedKind, selectedStory, showMai
|
||||
// This could leads to issues like below:
|
||||
// https://github.com/storybooks/react-storybook/issues/81
|
||||
ReactDOM.unmountComponentAtNode(rootEl);
|
||||
render(element, rootEl);
|
||||
showMain();
|
||||
render(element, rootEl);
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ export default function render({
|
||||
return;
|
||||
}
|
||||
|
||||
showMain();
|
||||
renderRoot({
|
||||
el: '#root',
|
||||
render(h) {
|
||||
return h('div', { attrs: { id: 'root' } }, [h(component)]);
|
||||
},
|
||||
});
|
||||
showMain();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user