Skip to content

Commit b96772a

Browse files
authored
refactor: remove unused asNotFound property (#72585)
1 parent 6357b54 commit b96772a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/next/src/client/components/not-found-boundary.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { MissingSlotContext } from '../../shared/lib/app-router-context.shared-r
99
interface NotFoundBoundaryProps {
1010
notFound?: React.ReactNode
1111
notFoundStyles?: React.ReactNode
12-
asNotFound?: boolean
1312
children: React.ReactNode
1413
missingSlots?: Set<string>
1514
}
@@ -31,7 +30,7 @@ class NotFoundErrorBoundary extends React.Component<
3130
constructor(props: NotFoundErrorBoundaryProps) {
3231
super(props)
3332
this.state = {
34-
notFoundTriggered: !!props.asNotFound,
33+
notFoundTriggered: false,
3534
previousPathname: props.pathname,
3635
}
3736
}
@@ -113,7 +112,6 @@ class NotFoundErrorBoundary extends React.Component<
113112
export function NotFoundBoundary({
114113
notFound,
115114
notFoundStyles,
116-
asNotFound,
117115
children,
118116
}: NotFoundBoundaryProps) {
119117
// When we're rendering the missing params shell, this will return null. This
@@ -129,7 +127,6 @@ export function NotFoundBoundary({
129127
pathname={pathname}
130128
notFound={notFound}
131129
notFoundStyles={notFoundStyles}
132-
asNotFound={asNotFound}
133130
missingSlots={missingSlots}
134131
>
135132
{children}

test/development/acceptance-app/hydration-error.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ describe('Error overlay for hydration errors in App router', () => {
458458
<ErrorBoundary errorComponent={undefined} errorStyles={undefined} errorScripts={undefined}>
459459
<LoadingBoundary hasLoading={false} loading={undefined} loadingStyles={undefined} loadingScripts={undefined}>
460460
<NotFoundBoundary notFound={[...]} notFoundStyles={[...]}>
461-
<NotFoundErrorBoundary pathname="/" notFound={[...]} notFoundStyles={[...]} asNotFound={undefined} ...>
461+
<NotFoundErrorBoundary pathname="/" notFound={[...]} notFoundStyles={[...]} missingSlots={Set}>
462462
<RedirectBoundary>
463463
<RedirectErrorBoundary router={{...}}>
464464
<InnerLayoutRouter parallelRouterKey="children" url="/" tree={[...]} childNodes={Map} ...>
@@ -927,7 +927,7 @@ describe('Error overlay for hydration errors in App router', () => {
927927
if (isTurbopack) {
928928
expect(fullPseudoHtml).toMatchInlineSnapshot(`
929929
"...
930-
<NotFoundErrorBoundary pathname="/" notFound={[...]} notFoundStyles={[...]} asNotFound={undefined} missingSlots={Set}>
930+
<NotFoundErrorBoundary pathname="/" notFound={[...]} notFoundStyles={[...]} missingSlots={Set}>
931931
<RedirectBoundary>
932932
<RedirectErrorBoundary router={{...}}>
933933
<InnerLayoutRouter parallelRouterKey="children" url="/" tree={[...]} childNodes={Map} segmentPath={[...]} ...>
@@ -947,7 +947,7 @@ describe('Error overlay for hydration errors in App router', () => {
947947
} else {
948948
expect(fullPseudoHtml).toMatchInlineSnapshot(`
949949
"...
950-
<NotFoundErrorBoundary pathname="/" notFound={[...]} notFoundStyles={[...]} asNotFound={undefined} missingSlots={Set}>
950+
<NotFoundErrorBoundary pathname="/" notFound={[...]} notFoundStyles={[...]} missingSlots={Set}>
951951
<RedirectBoundary>
952952
<RedirectErrorBoundary router={{...}}>
953953
<InnerLayoutRouter parallelRouterKey="children" url="/" tree={[...]} childNodes={Map} segmentPath={[...]} ...>

0 commit comments

Comments
 (0)