-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove React Suspense from Client Runtime (#8887)
- Loading branch information
1 parent
e930961
commit d9c6f20
Showing
2 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { Suspense } from 'react' | ||
import App from 'next/app' | ||
|
||
class MyApp extends App { | ||
render () { | ||
const { Component, pageProps } = this.props | ||
if (typeof window === 'undefined') { | ||
return <Component {...pageProps} /> | ||
} | ||
|
||
return ( | ||
<Suspense fallback={<div>Loading...</div>}> | ||
<Component {...pageProps} /> | ||
</Suspense> | ||
) | ||
} | ||
} | ||
|
||
export default MyApp |