mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-03 07:04:16 +00:00
17 lines
424 B
TypeScript
17 lines
424 B
TypeScript
![]() |
import React from "react";
|
||
|
|
||
|
const codeToRunOnClient = `(function() {
|
||
|
try {
|
||
|
var mode = localStorage.getItem('darkmode');
|
||
|
document.getElementsByTagName("html")[0].className === 'dark' ? 'dark' : 'light';
|
||
|
} catch (e) {}
|
||
|
})();`;
|
||
|
|
||
|
export const onRenderBody = ({ setHeadComponents }) =>
|
||
|
setHeadComponents([
|
||
|
<script
|
||
|
key="myscript"
|
||
|
dangerouslySetInnerHTML={{ __html: codeToRunOnClient }}
|
||
|
/>,
|
||
|
]);
|