mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 13:31:19 +08:00
Merge pull request #10971 from cpgruber/b/ember-double-render
fix ember double render
This commit is contained in:
commit
86323b128f
@ -15,8 +15,12 @@ const app = window.require(`${window.STORYBOOK_NAME}/app`).default.create({
|
||||
|
||||
let lastPromise = app.boot();
|
||||
let hasRendered = false;
|
||||
let isRendering = false;
|
||||
|
||||
function render(options: OptionsArgs, el: ElementArgs) {
|
||||
if (isRendering) return;
|
||||
isRendering = true;
|
||||
|
||||
const { template, context = {}, element } = options;
|
||||
|
||||
if (hasRendered) {
|
||||
@ -47,6 +51,7 @@ function render(options: OptionsArgs, el: ElementArgs) {
|
||||
component.appendTo(el);
|
||||
}
|
||||
hasRendered = true;
|
||||
isRendering = false;
|
||||
|
||||
return instance;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user