diff --git a/docs/rules/no-child-traversal-in-connectedcallback.md b/docs/rules/no-child-traversal-in-connectedcallback.md index aea6244..9c3ebd7 100644 --- a/docs/rules/no-child-traversal-in-connectedcallback.md +++ b/docs/rules/no-child-traversal-in-connectedcallback.md @@ -31,7 +31,7 @@ class FooBarElement extends HTMLElement { if (button) { button.disabled = true } - }).observe(this) + }).observe(this, {childList: true}) } } ``` @@ -52,3 +52,5 @@ class FooBarElement extends HTMLElement { ## When Not To Use It If you are comfortable with the edge cases of DOM traversal directly in the `connectedCallback` then you can disable this rule. + +If your element is appended to the DOM via `.innerHTML` or similar methods, you should disable this rule because in such a case, the children are are available during `connectedCallback` and no mutations events will fire. \ No newline at end of file