wp_back/wp-content/plugins/visual-portfolio/gutenberg/components/styles-render/index.js
2024-05-20 15:37:46 +03:00

21 lines
434 B
JavaScript

import { useEffect } from '@wordpress/element';
/**
* Render dynamic styles for editor.
*
* @param root0
* @param root0.children
* @return {null} nothing.
*/
export default function StylesRender({ children }) {
useEffect(() => {
const node = document.createElement('style');
node.innerHTML = children;
document.body.appendChild(node);
return () => document.body.removeChild(node);
}, [children]);
return null;
}