Skip to content

Commit

Permalink
fix(entry.server): provide nonce to react scripts
Browse files Browse the repository at this point in the history
This patch provides the `nonce` option to the React
`renderToPipeableStream` function so that React will add it to scripts
dynamically injected (e.g. the `<Suspense>` inline scripts).

Ref: https://react.dev/reference/react-dom/server/renderToPipeableStream#parameters
Ref: facebook/react#26026 (comment)
Ref: remix-run/remix#5156 (comment)
  • Loading branch information
nicholaschiang committed Sep 20, 2023
1 parent e26a859 commit 79dc8e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default async function handleRequest(...args: DocRequestArgs) {

console.error(error)
},
nonce,
},
)

Expand Down

0 comments on commit 79dc8e6

Please sign in to comment.