Skip to content

Commit

Permalink
fix runtime error flag
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Oct 23, 2024
1 parent 3165a86 commit 6b014c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ComponentStyles } from '../internal/styles/ComponentStyles'
import { CssReset } from '../internal/styles/CssReset'
import { RootLayoutMissingTagsError } from '../internal/container/root-layout-missing-tags-error'
import type { Dispatcher } from './hot-reloader-client'
import { RuntimeErrorHandler } from '../internal/helpers/runtime-error-handler'

interface ReactDevOverlayState {
reactError: SupportedErrorEvent | null
Expand All @@ -27,6 +28,7 @@ export default class ReactDevOverlay extends React.PureComponent<
static getDerivedStateFromError(error: Error): ReactDevOverlayState {
if (!error.stack) return { reactError: null }

RuntimeErrorHandler.hadRuntimeError = true
return {
reactError: {
id: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,6 @@ export default function HotReload({
const warning = errorDetails?.warning
const stitchedError = getReactStitchedError(error)

RuntimeErrorHandler.hadRuntimeError = true

dispatch({
type: ACTION_UNHANDLED_ERROR,
reason: stitchedError,
Expand Down

0 comments on commit 6b014c9

Please sign in to comment.