mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
20 lines
380 B
TypeScript
20 lines
380 B
TypeScript
import React from "react";
|
|
|
|
type Props = {
|
|
children: string;
|
|
};
|
|
|
|
export const ApplyStyles = ({ children }: Props) => {
|
|
React.useEffect(() => {
|
|
const element = document.createElement("style");
|
|
element.innerHTML = children;
|
|
document.head.appendChild(element);
|
|
|
|
return () => {
|
|
document.head.removeChild(element);
|
|
};
|
|
}, [children]);
|
|
|
|
return null;
|
|
};
|