pinterest-for-woocommerce
pinterest-for-woocommerce copied to clipboard
useBodyClasses hook is too tightly coupled to the client components.
As discussed here
This useBodyClasses
hook is problematic and too tightly coupled to the components.
The hook should not know anything about how/where it's used (e.g. style
param and all the specific classes added/removed). A better interface would be something like:
useBodyClasses( {
addClasses: [ 'woocommerce-onboarding', 'woocommerce-admin-full-screen' ],
removeClasses: [ 'woocommerce-admin-is-loading' ],
} );
Though there are possibly cleaner ways to wrangle any classes / changes outside the component, where necessary.
Ideally, we should avoid components having to change the DOM outside the component where possible.
Closely related to #11. Possibly easier to fix both at the same time.