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" ;
2
2
import { objectKeys } from "tsafe/objectKeys" ;
3
3
import { getAssetUrl } from "../tools/getAssetUrl" ;
4
4
import AppleTouchIcon from "../dsfr/favicon/apple-touch-icon.png" ;
@@ -94,34 +94,27 @@ export function DsfrHead(props: DsfrHeadProps) {
94
94
< link rel = "shortcut icon" href = { getAssetUrl ( FaviconIco ) } type = "image/x-icon" />
95
95
</ >
96
96
) }
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 && (
103
109
< script
104
110
suppressHydrationWarning
111
+ key = "nonce-setter"
105
112
nonce = { nonce }
106
113
dangerouslySetInnerHTML = { {
107
- "__html" : getScriptToRunAsap ( {
108
- defaultColorScheme,
109
- nonce,
110
- trustedTypesPolicyName
111
- } )
114
+ __html : `window.ssrNonce = "${ nonce } ";`
112
115
} }
113
116
/>
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
+ ) }
125
118
</ >
126
119
) ;
127
120
}
You can’t perform that action at this time.
0 commit comments