Skip to content

Commit

Permalink
[DevOverlay] Remove temporary header children
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi committed Jan 3, 2025
1 parent adfca52 commit 152f52e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ type ErrorOverlayLayoutProps = {
debugInfo?: DebugInfo
isBuildError?: boolean
onClose?: () => void
// TODO: remove this
temporaryHeaderChildren?: React.ReactNode
versionInfo?: VersionInfo
// TODO: better handle receiving
readyErrors?: ReadyRuntimeError[]
Expand All @@ -47,7 +45,6 @@ export function ErrorOverlayLayout({
debugInfo,
isBuildError,
onClose,
temporaryHeaderChildren,
versionInfo,
readyErrors,
activeIdx,
Expand Down Expand Up @@ -90,7 +87,6 @@ export function ErrorOverlayLayout({
>
{errorMessage}
</p>
{temporaryHeaderChildren}
</DialogHeader>
<DialogBody className="nextjs-container-errors-body">
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,50 +263,46 @@ export function Errors({
readyErrors={readyErrors}
activeIdx={activeIdx}
setActiveIndex={setActiveIndex}
temporaryHeaderChildren={
>
{notes ? (
<>
{notes ? (
<>
<p
id="nextjs__container_errors__notes"
className="nextjs__container_errors__notes"
>
{notes}
</p>
</>
) : null}
{hydrationWarning ? (
<p
id="nextjs__container_errors__link"
className="nextjs__container_errors__link"
>
<HotlinkedText text="See more info here: https://nextjs.org/docs/messages/react-hydration-error" />
</p>
) : null}

{hydrationWarning &&
(activeError.componentStackFrames?.length ||
!!errorDetails.reactOutputComponentDiff) ? (
<PseudoHtmlDiff
className="nextjs__container_errors__component-stack"
hydrationMismatchType={hydrationErrorType}
componentStackFrames={activeError.componentStackFrames || []}
firstContent={serverContent}
secondContent={clientContent}
reactOutputComponentDiff={errorDetails.reactOutputComponentDiff}
/>
) : null}
{isServerError ? (
<div>
<small>
This error happened while generating the page. Any console logs
will be displayed in the terminal window.
</small>
</div>
) : undefined}
<p
id="nextjs__container_errors__notes"
className="nextjs__container_errors__notes"
>
{notes}
</p>
</>
}
>
) : null}
{hydrationWarning ? (
<p
id="nextjs__container_errors__link"
className="nextjs__container_errors__link"
>
<HotlinkedText text="See more info here: https://nextjs.org/docs/messages/react-hydration-error" />
</p>
) : null}

{hydrationWarning &&
(activeError.componentStackFrames?.length ||
!!errorDetails.reactOutputComponentDiff) ? (
<PseudoHtmlDiff
className="nextjs__container_errors__component-stack"
hydrationMismatchType={hydrationErrorType}
componentStackFrames={activeError.componentStackFrames || []}
firstContent={serverContent}
secondContent={clientContent}
reactOutputComponentDiff={errorDetails.reactOutputComponentDiff}
/>
) : null}
{isServerError ? (
<div>
<small>
This error happened while generating the page. Any console logs will
be displayed in the terminal window.
</small>
</div>
) : undefined}
<RuntimeError key={activeError.id.toString()} error={activeError} />
</ErrorOverlayLayout>
)
Expand Down

0 comments on commit 152f52e

Please sign in to comment.