mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
* add isEqualNode function * add test * trying to make integration test work * revert * Update test/unit/is-equal-node.unit.test.js Co-authored-by: Steven <[email protected]> * Revert "revert" This reverts commit d67b9971068d18efcf839666a3a17619fd914fc3. * Fix tests * Use TS for unit test * Revert waitfor * Start tests with "should" * Fix lint * Use cloneNode() Co-authored-by: Eric Biewener <[email protected]> Co-authored-by: Steven <[email protected]>
25 lines
603 B
JavaScript
25 lines
603 B
JavaScript
import React from 'react'
|
|
import Head from 'next/head'
|
|
|
|
const Page = () => {
|
|
const [counter, setCounter] = React.useState(0)
|
|
const [useSrc1, setUseSrc1] = React.useState(true)
|
|
|
|
return (
|
|
<>
|
|
<Head>
|
|
<script nonce="abc123" src={useSrc1 ? '/src-1.js' : '/src-2.js'} />
|
|
</Head>
|
|
<h1 id="h1">{'Count ' + counter}</h1>
|
|
<button id="force-rerender" onClick={() => setCounter(counter + 1)}>
|
|
Re-render
|
|
</button>
|
|
<button id="change-script" onClick={() => setUseSrc1(!useSrc1)}>
|
|
Change script src
|
|
</button>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default Page
|