Merge pull request #3520 from Grimones/fix-preview-render-order

Fix render order in preview
This commit is contained in:
Filipp Riabchun 2018-05-02 17:59:21 +03:00 committed by GitHub
commit 3539625d7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
import { renderNgApp } from './angular/helpers';
export default function render({ story, showMain }) {
renderNgApp(story);
showMain();
renderNgApp(story);
}

View File

@ -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) });
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -32,11 +32,11 @@ export default function render({
return;
}
showMain();
renderRoot({
el: '#root',
render(h) {
return h('div', { attrs: { id: 'root' } }, [h(component)]);
},
});
showMain();
}