From 4259ea51cdbe7a029ea39b449238d5b43d5c83f0 Mon Sep 17 00:00:00 2001 From: Ayo Date: Thu, 21 Dec 2023 18:06:34 +0100 Subject: [PATCH] feat: update code example --- _posts/2023-12-15-reactive-custom-elements-with-html-dataset.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2023-12-15-reactive-custom-elements-with-html-dataset.md b/_posts/2023-12-15-reactive-custom-elements-with-html-dataset.md index c553f93..03c4002 100644 --- a/_posts/2023-12-15-reactive-custom-elements-with-html-dataset.md +++ b/_posts/2023-12-15-reactive-custom-elements-with-html-dataset.md @@ -32,7 +32,7 @@ Let's consider the following code example (also [in CodePen →](https://code class Counter extends HTMLElement { static observedAttributes = ["data-count"]; connectedCallback() { - this.dataset.count = this.getAttribute('data-count') ?? 0; + this.dataset.count = 0; this.onclick = () => ++this.dataset.count; } attributeChangedCallback(prop, oldValue, newValue) {