Skip to content

Commit aa5729c

Browse files
committed
Rollback fix #293
1 parent 0c93902 commit aa5729c

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

src/next-appdir/DsfrHead.tsx

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useMemo, Suspense } from "react";
1+
import React, { useMemo } from "react";
22
import { objectKeys } from "tsafe/objectKeys";
33
import { getAssetUrl } from "../tools/getAssetUrl";
44
import 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
}

0 commit comments

Comments
 (0)