Unverified Commit 68dc783f authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[dev-overlay] Remove unused fields from hydration error state (#77332)

parent 757a6e07
...@@ -6,7 +6,6 @@ import { ...@@ -6,7 +6,6 @@ import {
export type HydrationErrorState = { export type HydrationErrorState = {
// Hydration warning template format: <message> <serverContent> <clientContent> // Hydration warning template format: <message> <serverContent> <clientContent>
warning?: [string, string, string] warning?: [string, string, string]
componentStack?: string
serverContent?: string serverContent?: string
clientContent?: string clientContent?: string
// React 19 hydration diff format: <notes> <link> <component diff?> // React 19 hydration diff format: <notes> <link> <component diff?>
......
...@@ -515,8 +515,7 @@ export default function HotReload({ ...@@ -515,8 +515,7 @@ export default function HotReload({
| HydrationErrorState | HydrationErrorState
| undefined | undefined
// Component stack is added to the error in use-error-handler in case there was a hydration error // Component stack is added to the error in use-error-handler in case there was a hydration error
const componentStackTrace = const componentStackTrace = (error as any)._componentStack
(error as any)._componentStack || errorDetails?.componentStack
const warning = errorDetails?.warning const warning = errorDetails?.warning
dispatch({ dispatch({
......
import * as Bus from './bus' import * as Bus from './bus'
import { parseStack } from '../utils/parse-stack' import { parseStack } from '../utils/parse-stack'
import { parseComponentStack } from '../utils/parse-component-stack' import { parseComponentStack } from '../utils/parse-component-stack'
import { import { storeHydrationErrorStateFromConsoleArgs } from '../../errors/hydration-error-info'
hydrationErrorState,
storeHydrationErrorStateFromConsoleArgs,
} from '../../errors/hydration-error-info'
import { import {
ACTION_BEFORE_REFRESH, ACTION_BEFORE_REFRESH,
ACTION_BUILD_ERROR, ACTION_BUILD_ERROR,
...@@ -30,8 +27,7 @@ function handleError(error: unknown) { ...@@ -30,8 +27,7 @@ function handleError(error: unknown) {
attachHydrationErrorState(error) attachHydrationErrorState(error)
const componentStackTrace = const componentStackTrace = (error as any)._componentStack
(error as any)._componentStack || hydrationErrorState.componentStack
const componentStackFrames = const componentStackFrames =
typeof componentStackTrace === 'string' typeof componentStackTrace === 'string'
? parseComponentStack(componentStackTrace) ? parseComponentStack(componentStackTrace)
......
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