mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Changes to the beforeInteractive strategy to make it work for streaming Splitting `beforeInteractive` into two strategies `beforeInteractive` at the _document level and `beforePageRender` for page level <Scripts>
22 lines
413 B
JavaScript
22 lines
413 B
JavaScript
import Script from 'next/script'
|
|
|
|
const Page = () => {
|
|
return (
|
|
<div class="container">
|
|
<div>page1</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
Page.unstable_scriptLoader = () => {
|
|
return (
|
|
<Script
|
|
id="scriptBeforePageRender"
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js?a=scriptBeforePageRender"
|
|
strategy="beforePageRender"
|
|
></Script>
|
|
)
|
|
}
|
|
|
|
export default Page
|