first
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user