Skip to content

Instantly share code, notes, and snippets.

@sand97
Last active July 11, 2022 07:45
Show Gist options
  • Save sand97/55e69c1082380b1c9f0123f82c8de4aa to your computer and use it in GitHub Desktop.
Save sand97/55e69c1082380b1c9f0123f82c8de4aa to your computer and use it in GitHub Desktop.
Example of Nextjs Splash screen _document.js
import React from 'react'
import Document, {Html, Head, Main, NextScript} from 'next/document'
import loader from "../src/loader";
class MyDocument extends Document {
render() {
return (
<Html>
<Head/>
<head>
<style>
{loader}
</style>
</head>
<body>
<div id={'globalLoader'}>
<div className="loader">
<div/>
<div/>
</div>
</div>
<Main/>
<NextScript/>
</body>
</Html>
)
}
}
export default MyDocument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment