Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set style nonce in root styles
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent f97ce95 commit 3f07ebf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/root.tsx
Expand Up @@ -113,6 +113,7 @@ export async function loader({

if (context.data.current_user) data = { ...context.data.current_user };
if (context.env.DSN) data.dsn = context.env.DSN;
if (context.data.nonce) data.nonce = context.data.nonce;
if (context.data.theme) data.theme = context.data.theme;

return data;
Expand Down Expand Up @@ -175,6 +176,7 @@ function getMarkup(
{serverStyleData?.map(({ key, ids, css }) => (
<style
key={key}
nonce={loaderData.nonce}
data-emotion={`${key} ${ids.join(" ")}`}
dangerouslySetInnerHTML={{ __html: css }}
/>
Expand Down

0 comments on commit 3f07ebf

Please sign in to comment.