mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
While investigating https://github.com/vercel/next.js/pull/78936 we noticed that manually setting `nonce` prop on `next/script` tag it wasn't honored properly. This ensures we fully propagate it when manually set as a prop. --------- Co-authored-by: Zack Tanner <[email protected]>
19 lines
482 B
JavaScript
19 lines
482 B
JavaScript
import Script from 'next/script'
|
|
import { ShowScriptOrder } from '../app/script-nonce/show-order'
|
|
|
|
export default function Page() {
|
|
return (
|
|
<>
|
|
<p>script-nonce</p>
|
|
<Script strategy="afterInteractive" src="/test1.js" nonce="hello-world" />
|
|
<Script
|
|
strategy="beforeInteractive"
|
|
src="/test2.js"
|
|
nonce="hello-world"
|
|
/>
|
|
<Script strategy="beforeInteractive" id="3" nonce="hello-world" />
|
|
<ShowScriptOrder />
|
|
</>
|
|
)
|
|
}
|