remove jquery-in-react
This commit is contained in:
parent
60f0d04e1c
commit
9db7e547f1
|
@ -45,8 +45,17 @@ const Settings = ( { params } ) => {
|
||||||
sidebarVisisble
|
sidebarVisisble
|
||||||
);
|
);
|
||||||
|
|
||||||
const event = new Event( 'reactRendered' );
|
// Append a new script tag
|
||||||
window.dispatchEvent( event );
|
const script = document.createElement( 'script' );
|
||||||
|
script.src =
|
||||||
|
'http://localhost:8888/wp-content/plugins/woocommerce/assets/js/admin/wc-shipping-classes.js';
|
||||||
|
script.async = true;
|
||||||
|
document.body.appendChild( script );
|
||||||
|
|
||||||
|
// Cleanup function to remove the script when the component unmounts
|
||||||
|
return () => {
|
||||||
|
document.body.removeChild( script );
|
||||||
|
};
|
||||||
}, [ params.page, section, sidebarVisisble ] );
|
}, [ params.page, section, sidebarVisisble ] );
|
||||||
|
|
||||||
// Register the slot fills for the settings page just once.
|
// Register the slot fills for the settings page just once.
|
||||||
|
|
Loading…
Reference in New Issue