Unverified Commit 2a1dc3c6 authored by Yuddomack's avatar Yuddomack Committed by GitHub

Clear unnecessary code (#38900)

This always seems to execute.
unless there is a special reason, I think it can declare and assign at the same time, how about this?

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
parent d034fff6
...@@ -1604,18 +1604,10 @@ export default class Router implements BaseRouter { ...@@ -1604,18 +1604,10 @@ export default class Router implements BaseRouter {
} }
try { try {
let Component: ComponentType
let styleSheets: StyleSheetTuple[]
let props: Record<string, any> | undefined let props: Record<string, any> | undefined
const { page: Component, styleSheets } = await this.fetchComponent(
if ( '/_error'
typeof Component! === 'undefined' || )
typeof styleSheets! === 'undefined'
) {
;({ page: Component, styleSheets } = await this.fetchComponent(
'/_error'
))
}
const routeInfo: CompletePrivateRouteInfo = { const routeInfo: CompletePrivateRouteInfo = {
props, props,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment