Skip to content

Commit

Permalink
change the timing for clearing the inlined data buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Mar 17, 2022
1 parent bc46022 commit fbb4491
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/next/client/index.tsx
Expand Up @@ -710,6 +710,7 @@ if (process.env.__NEXT_RSC) {
if (initialServerDataWriter && !initialServerDataWriter.closed) {
initialServerDataWriter.close()
}
initialServerDataBuffer = undefined
},
false
)
Expand Down Expand Up @@ -771,9 +772,6 @@ if (process.env.__NEXT_RSC) {
React.useEffect(() => {
rscCache.delete(cacheKey)
})
React.useEffect(() => {
initialServerDataBuffer = undefined
}, [])
const response = useServerResponse(cacheKey, serialized)
const root = response.readRoot()
return root
Expand Down

0 comments on commit fbb4491

Please sign in to comment.