From 969b3041938312edc68ef47402313bc052b216c4 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:49:33 -0400 Subject: [PATCH] Add nonce parameter to cache creator --- app/createEmotionCache.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/createEmotionCache.ts b/app/createEmotionCache.ts index 43ebf0d..5f293a2 100644 --- a/app/createEmotionCache.ts +++ b/app/createEmotionCache.ts @@ -2,11 +2,11 @@ import createCache from "@emotion/cache"; export const defaultCache = createEmotionCache(); -export default function createEmotionCache() { +export default function createEmotionCache(nonce?: string) { // The browser throws when calling .default, but the server throws if we don't call .default // Of course! return typeof document === "undefined" - ? createCache.default({ key: "cha" }) + ? createCache.default({ key: "cha", nonce }) : // @ts-expect-error - createCache({ key: "cha" }); + createCache({ key: "cha", nonce }); }