From 79dc8e60be297bffc8bd574acb792d2faa804760 Mon Sep 17 00:00:00 2001 From: Nicholas Chiang Date: Wed, 20 Sep 2023 11:16:53 -0600 Subject: [PATCH] fix(entry.server): provide nonce to react scripts This patch provides the `nonce` option to the React `renderToPipeableStream` function so that React will add it to scripts dynamically injected (e.g. the `` inline scripts). Ref: https://react.dev/reference/react-dom/server/renderToPipeableStream#parameters Ref: https://github.com/facebook/react/issues/26026#issuecomment-1398640424 Ref: https://github.com/remix-run/remix/issues/5156#issuecomment-1397935995 --- app/entry.server.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/entry.server.tsx b/app/entry.server.tsx index 2d8e268b..98aac390 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -72,6 +72,7 @@ export default async function handleRequest(...args: DocRequestArgs) { console.error(error) }, + nonce, }, )