From 2d2bd4106aecb2b7d02118ea3657de21ca1554ef Mon Sep 17 00:00:00 2001 From: Kate Higa Date: Wed, 13 Apr 2022 09:43:01 -0700 Subject: [PATCH] * quick removal of conflicting rec --- docs/rules/no-dom-traversal-in-attributechangedcallback.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/rules/no-dom-traversal-in-attributechangedcallback.md b/docs/rules/no-dom-traversal-in-attributechangedcallback.md index ecbb888..b76dacc 100644 --- a/docs/rules/no-dom-traversal-in-attributechangedcallback.md +++ b/docs/rules/no-dom-traversal-in-attributechangedcallback.md @@ -25,7 +25,6 @@ document.body.innerHTML = '' Guarding against `null` properties, or returning early for `isConnected === false` is not good enough because there is high risk that attribute changes won't be properly propagated and state can fall out of sync. Guarding against these means adding duplicate code in other lifecycle callbacks such as `connectedCallback` to ensure this state does not fall out of sync. It is instead preferable to move such DOM traversals away from `attributeChangedCallback`, using one of the following: -- move traversals to `connectedCallback` - dispatch events from `attributeChangedCallback`, binding event listeners on the element itself within `connectedCallback` - defer DOM traversals to just-in-time lookup using methods or getters.