0

fix(js): do not fire dangerouslySetInnerHTML if there is nothing to render. Closes #4075 (#4076)

This commit is contained in:
Gabe Kangas 2025-01-08 15:10:35 -08:00 committed by GitHub
parent 0140601335
commit 048acbce88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 11 deletions

View File

@ -27,22 +27,26 @@ export const Theme: FC = () => {
<Head>
<meta name="theme-color" content={themeColor} />
</Head>
<style
dangerouslySetInnerHTML={{
__html: `
{(appearanceVariables?.keys?.length || 0) > 0 && (
<style
dangerouslySetInnerHTML={{
__html: `
:root {
${appearanceVars.join(';\n')}
}
`,
}}
/>
<style
dangerouslySetInnerHTML={{
__html: `
}}
/>
)}
{customStyles !== '' && (
<style
dangerouslySetInnerHTML={{
__html: `
${customStyles}
`,
}}
/>
}}
/>
)}
</>
);
};

View File

@ -145,4 +145,4 @@
"emoji-mart": "5.2.2"
}
}
}
}