pinterest-for-woocommerce icon indicating copy to clipboard operation
pinterest-for-woocommerce copied to clipboard

Setup guide component modifies `document.body` classes (outside component) in a side effect - can this be avoided?

Open ksere opened this issue 3 years ago • 1 comments

As discussed here

Need to justify why components need to affect the DOM outside the component (body classes etc) - this is unusual.

Ideally the component wouldn't need to modify anything on the page outside of the component. Hopefully there's a way to refactor this so the component is self-contained.

If this is unavoidable then it should be clarified in the code (comment / rationale).

ksere avatar Apr 29 '21 17:04 ksere

The core issue here is that components should not be modifying the DOM outside the component. Retitling to clarify this is the actual issue.

haszari avatar Jun 27 '21 22:06 haszari