mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Fix Failed to execute 'measure' on 'Performance' error (#32823)
When `startTime` still has its initial value of `-1.1` we must not call
`logComponentMount`. This can occur when rendering a `'next/dynamic'`
component with `{ssr: false}` in a client component, for example.
Unfortunately, I didn't manage to reproduce this scenario in a unit
test.
This commit is contained in:
+2
-2
@@ -3756,7 +3756,7 @@ function commitPassiveMountOnFiber(
|
||||
) {
|
||||
// Log the reappear in the render phase.
|
||||
const startTime = ((finishedWork.actualStartTime: any): number);
|
||||
if (endTime - startTime > 0.05) {
|
||||
if (startTime >= 0 && endTime - startTime > 0.05) {
|
||||
logComponentReappeared(finishedWork, startTime, endTime);
|
||||
}
|
||||
if (
|
||||
@@ -3861,7 +3861,7 @@ function commitPassiveMountOnFiber(
|
||||
if (isMount) {
|
||||
// Log the mount in the render phase.
|
||||
const startTime = ((finishedWork.actualStartTime: any): number);
|
||||
if (endTime - startTime > 0.05) {
|
||||
if (startTime >= 0 && endTime - startTime > 0.05) {
|
||||
logComponentMount(finishedWork, startTime, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user