Skip to content

Commit d0f0dc9

Browse files
committed
[dev-overlay] Remove unused fields from hydration error state
1 parent de0c28f commit d0f0dc9

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

Diff for: packages/next/src/client/components/errors/hydration-error-info.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
export type HydrationErrorState = {
77
// Hydration warning template format: <message> <serverContent> <clientContent>
88
warning?: [string, string, string]
9-
componentStack?: string
109
serverContent?: string
1110
clientContent?: string
1211
// React 19 hydration diff format: <notes> <link> <component diff?>

Diff for: packages/next/src/client/components/react-dev-overlay/app/hot-reloader-client.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,7 @@ export default function HotReload({
515515
| HydrationErrorState
516516
| undefined
517517
// Component stack is added to the error in use-error-handler in case there was a hydration error
518-
const componentStackTrace =
519-
(error as any)._componentStack || errorDetails?.componentStack
518+
const componentStackTrace = (error as any)._componentStack
520519
const warning = errorDetails?.warning
521520

522521
dispatch({

Diff for: packages/next/src/client/components/react-dev-overlay/pages/client.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import * as Bus from './bus'
22
import { parseStack } from '../utils/parse-stack'
33
import { parseComponentStack } from '../utils/parse-component-stack'
4-
import {
5-
hydrationErrorState,
6-
storeHydrationErrorStateFromConsoleArgs,
7-
} from '../../errors/hydration-error-info'
4+
import { storeHydrationErrorStateFromConsoleArgs } from '../../errors/hydration-error-info'
85
import {
96
ACTION_BEFORE_REFRESH,
107
ACTION_BUILD_ERROR,
@@ -30,8 +27,7 @@ function handleError(error: unknown) {
3027

3128
attachHydrationErrorState(error)
3229

33-
const componentStackTrace =
34-
(error as any)._componentStack || hydrationErrorState.componentStack
30+
const componentStackTrace = (error as any)._componentStack
3531
const componentStackFrames =
3632
typeof componentStackTrace === 'string'
3733
? parseComponentStack(componentStackTrace)

0 commit comments

Comments
 (0)