Last active
July 11, 2022 07:45
-
-
Save sand97/55e69c1082380b1c9f0123f82c8de4aa to your computer and use it in GitHub Desktop.
Example of Nextjs Splash screen _document.js
This file contains hidden or 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
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