File tree Expand file tree Collapse file tree 1 file changed +16
-23
lines changed Expand file tree Collapse file tree 1 file changed +16
-23
lines changed Original file line number Diff line number Diff line change 1- import React , { useMemo , Suspense } from "react" ;
1+ import React , { useMemo } from "react" ;
22import { objectKeys } from "tsafe/objectKeys" ;
33import { getAssetUrl } from "../tools/getAssetUrl" ;
44import AppleTouchIcon from "../dsfr/favicon/apple-touch-icon.png" ;
@@ -94,34 +94,27 @@ export function DsfrHead(props: DsfrHeadProps) {
9494 < link rel = "shortcut icon" href = { getAssetUrl ( FaviconIco ) } type = "image/x-icon" />
9595 </ >
9696 ) }
97- { /*
98- This suspense is only a workaround for an incompatibility between RSC and Cypress.
99- See: https://github.com/cypress-io/cypress/issues/27204#issuecomment-1625490068
100- It is in practice a no-op.
101- */ }
102- < Suspense >
97+ < script
98+ suppressHydrationWarning
99+ nonce = { nonce }
100+ dangerouslySetInnerHTML = { {
101+ "__html" : getScriptToRunAsap ( {
102+ defaultColorScheme,
103+ nonce,
104+ trustedTypesPolicyName
105+ } )
106+ } }
107+ />
108+ { nonce !== undefined && (
103109 < script
104110 suppressHydrationWarning
111+ key = "nonce-setter"
105112 nonce = { nonce }
106113 dangerouslySetInnerHTML = { {
107- "__html" : getScriptToRunAsap ( {
108- defaultColorScheme,
109- nonce,
110- trustedTypesPolicyName
111- } )
114+ __html : `window.ssrNonce = "${ nonce } ";`
112115 } }
113116 />
114- { nonce !== undefined && (
115- < script
116- suppressHydrationWarning
117- key = "nonce-setter"
118- nonce = { nonce }
119- dangerouslySetInnerHTML = { {
120- __html : `window.ssrNonce = "${ nonce } ";`
121- } }
122- />
123- ) }
124- </ Suspense >
117+ ) }
125118 </ >
126119 ) ;
127120}
You can’t perform that action at this time.
0 commit comments