Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/next/src/client/components/not-found-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ class NotFoundErrorBoundary extends React.Component<
notFoundTriggered: true,
}
}
// Re-throw if error is not for 404
throw error
return {
notFoundTriggered: false,
}
}

static getDerivedStateFromProps(
Expand Down
6 changes: 4 additions & 2 deletions packages/next/src/client/components/redirect-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ export class RedirectErrorBoundary extends React.Component<
const redirectType = getRedirectTypeFromError(error)
return { redirect: url, redirectType }
}
// Re-throw if error is not for redirect
throw error
return {
redirect: null,
redirectType: null,
}
}

// Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific the the `@types/react` version.
Expand Down