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> <Head>
<meta name="theme-color" content={themeColor} /> <meta name="theme-color" content={themeColor} />
</Head> </Head>
<style {(appearanceVariables?.keys?.length || 0) > 0 && (
dangerouslySetInnerHTML={{ <style
__html: ` dangerouslySetInnerHTML={{
__html: `
:root { :root {
${appearanceVars.join(';\n')} ${appearanceVars.join(';\n')}
} }
`, `,
}} }}
/> />
<style )}
dangerouslySetInnerHTML={{ {customStyles !== '' && (
__html: ` <style
dangerouslySetInnerHTML={{
__html: `
${customStyles} ${customStyles}
`, `,
}} }}
/> />
)}
</> </>
); );
}; };

View File

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