Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
More React 17 clean up (vercel#26775)
Browse files Browse the repository at this point in the history
Remove unnecessary `React.Suspense` checks, as the minimum supported version is `react@>=17.0.1`. Also removes some files from the `react-18` integration test that are no longer necessary as of vercel#26664.
  • Loading branch information
devknoll committed Aug 2, 2021
1 parent 362ed31 commit 531885e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
10 changes: 0 additions & 10 deletions packages/next/bin/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@ if (process.env.NODE_ENV && !standardEnv.includes(process.env.NODE_ENV)) {

;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv

// this needs to come after we set the correct NODE_ENV or
// else it might cause SSR to break
const React = require('react')

if (typeof React.Suspense === 'undefined') {
throw new Error(
`The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install react react-dom" https://nextjs.org/docs/messages/invalid-react-version`
)
}

// Make sure commands gracefully respect termination signals (e.g. from Docker)
process.on('SIGTERM', () => process.exit(0))
process.on('SIGINT', () => process.exit(0))
Expand Down
6 changes: 0 additions & 6 deletions packages/next/server/dev/next-dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ import {
} from '../load-components'
import { DecodeError } from '../../shared/lib/utils'

if (typeof React.Suspense === 'undefined') {
throw new Error(
`The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install react react-dom" https://nextjs.org/docs/messages/invalid-react-version`
)
}

// Load ReactDevOverlay only when needed
let ReactDevOverlayImpl: React.FunctionComponent
const ReactDevOverlay = (props: any) => {
Expand Down
17 changes: 0 additions & 17 deletions test/unit/handles-incorrect-react.unit.test.js

This file was deleted.

0 comments on commit 531885e

Please sign in to comment.