Unverified Commit 2f795189 authored by Shu Ding's avatar Shu Ding Committed by GitHub

fix double render in strict mode (#34333)

Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent c0c11ad9
...@@ -775,9 +775,11 @@ if (process.env.__NEXT_RSC) { ...@@ -775,9 +775,11 @@ if (process.env.__NEXT_RSC) {
serialized?: string serialized?: string
_fresh?: boolean _fresh?: boolean
}) => { }) => {
React.useEffect(() => {
rscCache.delete(cacheKey)
})
const response = useServerResponse(cacheKey, serialized) const response = useServerResponse(cacheKey, serialized)
const root = response.readRoot() const root = response.readRoot()
rscCache.delete(cacheKey)
return root return root
} }
......
const withReact18 = require('../../react-18/test/with-react-18') const withReact18 = require('../../react-18/test/with-react-18')
module.exports = withReact18({ module.exports = withReact18({
reactStrictMode: true,
onDemandEntries: { onDemandEntries: {
maxInactiveAge: 1000 * 60 * 60, maxInactiveAge: 1000 * 60 * 60,
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment