Skip to content

Commit a07559f

Browse files
authored
[DevOverlay] Remove temporary header children (vercel#74490)
### Why? The header children were temporary because they will affect the test utils in the future, we need to change these query selectors from `data-nextjs-dialog-header` to `data-nextjs-dialog-body`: https://github.com/vercel/next.js/blob/bca0bc921bd81f25e6d8f83d676774724a007bfa/test/lib/next-test-utils.ts#L983-L986 This is not a severe blocker, and we may follow up on this during the QA period when we enable CI tests for the new UI. We may even have to unify the target attributes for testing before the change.
1 parent 1355dfa commit a07559f

File tree

2 files changed

+38
-46
lines changed

2 files changed

+38
-46
lines changed

packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/ErrorOverlayLayout/ErrorOverlayLayout.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ type ErrorOverlayLayoutProps = {
2929
debugInfo?: DebugInfo
3030
isBuildError?: boolean
3131
onClose?: () => void
32-
// TODO: remove this
33-
temporaryHeaderChildren?: React.ReactNode
3432
versionInfo?: VersionInfo
3533
// TODO: better handle receiving
3634
readyErrors?: ReadyRuntimeError[]
@@ -47,7 +45,6 @@ export function ErrorOverlayLayout({
4745
debugInfo,
4846
isBuildError,
4947
onClose,
50-
temporaryHeaderChildren,
5148
versionInfo,
5249
readyErrors,
5350
activeIdx,
@@ -90,7 +87,6 @@ export function ErrorOverlayLayout({
9087
>
9188
{errorMessage}
9289
</p>
93-
{temporaryHeaderChildren}
9490
</DialogHeader>
9591
<DialogBody className="nextjs-container-errors-body">
9692
{children}

packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.tsx

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -263,50 +263,46 @@ export function Errors({
263263
readyErrors={readyErrors}
264264
activeIdx={activeIdx}
265265
setActiveIndex={setActiveIndex}
266-
temporaryHeaderChildren={
266+
>
267+
{notes ? (
267268
<>
268-
{notes ? (
269-
<>
270-
<p
271-
id="nextjs__container_errors__notes"
272-
className="nextjs__container_errors__notes"
273-
>
274-
{notes}
275-
</p>
276-
</>
277-
) : null}
278-
{hydrationWarning ? (
279-
<p
280-
id="nextjs__container_errors__link"
281-
className="nextjs__container_errors__link"
282-
>
283-
<HotlinkedText text="See more info here: https://nextjs.org/docs/messages/react-hydration-error" />
284-
</p>
285-
) : null}
286-
287-
{hydrationWarning &&
288-
(activeError.componentStackFrames?.length ||
289-
!!errorDetails.reactOutputComponentDiff) ? (
290-
<PseudoHtmlDiff
291-
className="nextjs__container_errors__component-stack"
292-
hydrationMismatchType={hydrationErrorType}
293-
componentStackFrames={activeError.componentStackFrames || []}
294-
firstContent={serverContent}
295-
secondContent={clientContent}
296-
reactOutputComponentDiff={errorDetails.reactOutputComponentDiff}
297-
/>
298-
) : null}
299-
{isServerError ? (
300-
<div>
301-
<small>
302-
This error happened while generating the page. Any console logs
303-
will be displayed in the terminal window.
304-
</small>
305-
</div>
306-
) : undefined}
269+
<p
270+
id="nextjs__container_errors__notes"
271+
className="nextjs__container_errors__notes"
272+
>
273+
{notes}
274+
</p>
307275
</>
308-
}
309-
>
276+
) : null}
277+
{hydrationWarning ? (
278+
<p
279+
id="nextjs__container_errors__link"
280+
className="nextjs__container_errors__link"
281+
>
282+
<HotlinkedText text="See more info here: https://nextjs.org/docs/messages/react-hydration-error" />
283+
</p>
284+
) : null}
285+
286+
{hydrationWarning &&
287+
(activeError.componentStackFrames?.length ||
288+
!!errorDetails.reactOutputComponentDiff) ? (
289+
<PseudoHtmlDiff
290+
className="nextjs__container_errors__component-stack"
291+
hydrationMismatchType={hydrationErrorType}
292+
componentStackFrames={activeError.componentStackFrames || []}
293+
firstContent={serverContent}
294+
secondContent={clientContent}
295+
reactOutputComponentDiff={errorDetails.reactOutputComponentDiff}
296+
/>
297+
) : null}
298+
{isServerError ? (
299+
<div>
300+
<small>
301+
This error happened while generating the page. Any console logs will
302+
be displayed in the terminal window.
303+
</small>
304+
</div>
305+
) : undefined}
310306
<RuntimeError key={activeError.id.toString()} error={activeError} />
311307
</ErrorOverlayLayout>
312308
)

0 commit comments

Comments
 (0)