Skip to content

Commit

Permalink
Merge pull request #513 from edkimmel/unescape-state-script
Browse files Browse the repository at this point in the history
fix: unistyles state was escaped leading to invalid syntax
  • Loading branch information
Brentlok authored Jan 22, 2025
2 parents a9d2b44 + d4530d1 commit a30aa8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/getServerUnistyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const getServerUnistyles = ({ includeRNWStyles = true }: ServerUnistylesS
return <>
{rnwStyle && <style id='rnw-style'>{rnwStyle}</style>}
<style id='unistyles-web'>{css}</style>
<script id='unistyles-script'>{`window.__UNISTYLES_STATE__ = ${JSON.stringify(state)}`}</script>
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: Needs the json quotes to be unescaped */}
<script id='unistyles-script' dangerouslySetInnerHTML={{ __html: `window.__UNISTYLES_STATE__ = ${JSON.stringify(state)}`}} />
</>
}

0 comments on commit a30aa8e

Please sign in to comment.