Pass nonce to children

This commit is contained in:
2023-10-19 16:49:34 -04:00
parent 70b43410ce
commit 5e7779a08d
3 changed files with 10 additions and 5 deletions

View File

@ -10,9 +10,9 @@ export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
remixContext: EntryContext & RequestContext
) {
const cache = createEmotionCache();
const cache = createEmotionCache(remixContext.data.nonce);
const { extractCriticalToChunks } = createEmotionServer(cache);
const html = renderToString(
<ServerStyleContext.Provider value={null}>