Skip to content

Commit 08eb997

Browse files
committed
Update lib to fix an issue with lifecycle hooks
1 parent 588da08 commit 08eb997

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/dev/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ module.exports = {
4242
}
4343

4444
const proto = class extends HTMLElement {
45+
constructor() {
46+
super();
47+
this.extractedAttributes = extractAttributes(this);
48+
}
49+
50+
static get observedAttributes() {
51+
debugger;
52+
return this.extractAttributes.values();
53+
}
54+
4555
connectedCallback() {
4656
const webComponentInstance = this;
4757
let mountPoint = webComponentInstance;
@@ -63,8 +73,8 @@ module.exports = {
6373

6474
retargetEvents(shadowRoot);
6575
}
66-
67-
ReactDOM.render(React.cloneElement(app, extractAttributes(webComponentInstance)) , mountPoint, function () {
76+
77+
ReactDOM.render(React.cloneElement(app, this.extractedAttributes), mountPoint, function () {
6878
appInstance = this;
6979

7080
callConstructorHook(webComponentInstance);

src/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)