Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix render order in preview #3520

Merged
merged 2 commits into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/angular/src/client/preview/render.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { renderNgApp } from './angular/helpers';

export default function render({ story, showMain }) {
renderNgApp(story);
showMain();
renderNgApp(story);
}
2 changes: 1 addition & 1 deletion app/mithril/src/client/preview/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) });
}
3 changes: 2 additions & 1 deletion app/polymer/src/client/preview/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -28,5 +30,4 @@ export default function renderMain({ story, selectedKind, selectedStory, showMai
rootElement.innerHTML = '';
rootElement.appendChild(component);
}
showMain();
}
2 changes: 1 addition & 1 deletion app/react/src/client/preview/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion app/vue/src/client/preview/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export default function render({
return;
}

showMain();
renderRoot({
el: '#root',
render(h) {
return h('div', { attrs: { id: 'root' } }, [h(component)]);
},
});
showMain();
}