Skip to content

Commit

Permalink
fix double render in strict mode (#34333)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
shuding and kodiakhq[bot] committed Feb 14, 2022
1 parent c0c11ad commit 2f79518
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/client/index.tsx
Expand Up @@ -775,9 +775,11 @@ if (process.env.__NEXT_RSC) {
serialized?: string
_fresh?: boolean
}) => {
React.useEffect(() => {
rscCache.delete(cacheKey)
})
const response = useServerResponse(cacheKey, serialized)
const root = response.readRoot()
rscCache.delete(cacheKey)
return root
}

Expand Down
@@ -1,6 +1,7 @@
const withReact18 = require('../../react-18/test/with-react-18')

module.exports = withReact18({
reactStrictMode: true,
onDemandEntries: {
maxInactiveAge: 1000 * 60 * 60,
},
Expand Down

0 comments on commit 2f79518

Please sign in to comment.