Skip to content

Commit f8e3f0f

Browse files
committed
Fix: ensuring we always render the latest app state
1 parent 9591369 commit f8e3f0f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

package-lock.json

+13-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ReactHTMLElement.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class ReactHTMLElement extends HTMLElement {
2323

2424
private _awaitingRoot = false;
2525

26+
private _app: Renderable | undefined;
27+
2628
private getShadowRoot(): ShadowRoot {
2729
return this.shadowRoot || this.attachShadow({ mode: 'open' });
2830
}
@@ -72,8 +74,9 @@ class ReactHTMLElement extends HTMLElement {
7274
}
7375

7476
async renderRoot(app: Renderable): Promise<void> {
77+
this._app = app; // this value may change while we wait for root...
7578
const root = await this.root();
76-
root.render(app);
79+
root.render(this._app); // always render current app
7780
}
7881

7982
disconnectedCallback(): void {

0 commit comments

Comments
 (0)